use of org.apache.geode.distributed.internal.ReplyProcessor21 in project geode by apache.
the class ReleaseClearLockMessage method send.
public static void send(Set<InternalDistributedMember> members, DM dm, String regionPath) throws ReplyException {
ReplyProcessor21 processor = new ReplyProcessor21(dm, members);
ReleaseClearLockMessage msg = new ReleaseClearLockMessage(regionPath, processor.getProcessorId());
msg.setRecipients(members);
dm.putOutgoing(msg);
processor.waitForRepliesUninterruptibly();
}
use of org.apache.geode.distributed.internal.ReplyProcessor21 in project geode by apache.
the class DestroyRegionOnDataStoreMessage method send.
/**
* Sends a DestroyRegionOnDataStoreMessage requesting that another VM destroy an existing region
*
*/
public static void send(InternalDistributedMember recipient, PartitionedRegion r, Object callbackArg) {
DM dm = r.getDistributionManager();
ReplyProcessor21 rp = new ReplyProcessor21(dm, recipient);
int procId = rp.getProcessorId();
DestroyRegionOnDataStoreMessage m = new DestroyRegionOnDataStoreMessage(recipient, r.getPRId(), rp, callbackArg);
r.getDistributionManager().putOutgoing(m);
rp.waitForRepliesUninterruptibly();
}
use of org.apache.geode.distributed.internal.ReplyProcessor21 in project geode by apache.
the class EndBucketCreationMessage method send.
/**
* Sends a message to make the recipient primary for the bucket.
*
* @param acceptedMembers
*
* @param newPrimary the member to to become primary
* @param pr the PartitionedRegion of the bucket
* @param bid the bucket to become primary for
*/
public static void send(Collection<InternalDistributedMember> acceptedMembers, InternalDistributedMember newPrimary, PartitionedRegion pr, int bid) {
Assert.assertTrue(newPrimary != null, "VolunteerPrimaryBucketMessage NULL recipient");
ReplyProcessor21 response = new ReplyProcessor21(pr.getSystem(), acceptedMembers);
EndBucketCreationMessage msg = new EndBucketCreationMessage(acceptedMembers, pr.getPRId(), response, bid, newPrimary);
pr.getDistributionManager().putOutgoing(msg);
}
use of org.apache.geode.distributed.internal.ReplyProcessor21 in project geode by apache.
the class FlushMessage method process.
/*
* Used both for the reciept of a FlushMessage and the reply to a Flushmessage
*/
@Override
protected void process(DistributionManager dm) {
if (this.bucketId != Integer.MIN_VALUE) {
if (logger.isDebugEnabled()) {
logger.debug("Received sent FlushMessage {}", this);
}
try {
final PartitionedRegion p = PartitionedRegion.getPRFromId(this.prId);
Assert.assertTrue(p.getRegionAdvisor().isPrimaryForBucket(this.bucketId));
} catch (PRLocallyDestroyedException fre) {
if (logger.isDebugEnabled()) {
logger.debug("Sending reply despite Region getting locally destroyed prId={}", this.prId, fre);
}
} catch (CacheRuntimeException ce) {
logger.debug("Sending reply despite unavailable Partitioned Region using prId={}", this.prId, ce);
} finally {
dm.putOutgoing(new FlushMessage(this.prId, Integer.MIN_VALUE, getProcessorId(), getSender()));
}
} else {
if (logger.isDebugEnabled()) {
logger.debug("Processing FlushMessage as a response {}", this);
}
ReplyProcessor21 rep = ReplyProcessor21.getProcessor(this.processorId);
if (rep != null) {
rep.process(this);
}
}
}
use of org.apache.geode.distributed.internal.ReplyProcessor21 in project geode by apache.
the class AcceptorImpl method notifyCacheMembersOfClose.
private void notifyCacheMembersOfClose() {
if (!this.cache.forcedDisconnect()) {
for (PartitionedRegion pr : this.cache.getPartitionedRegions()) {
Map<Integer, BucketAdvisor.BucketProfile> profiles = new HashMap<>();
// get all local real bucket advisors
Map<Integer, BucketAdvisor> advisors = pr.getRegionAdvisor().getAllBucketAdvisors();
for (Map.Entry<Integer, BucketAdvisor> entry : advisors.entrySet()) {
BucketAdvisor advisor = entry.getValue();
BucketProfile bp = (BucketProfile) advisor.createProfile();
advisor.updateServerBucketProfile(bp);
profiles.put(entry.getKey(), bp);
}
Set recipients = pr.getRegionAdvisor().adviseAllPRNodes();
// send it to all in one message
ReplyProcessor21 reply = AllBucketProfilesUpdateMessage.send(recipients, pr.getDistributionManager(), pr.getPRId(), profiles, true);
if (reply != null) {
reply.waitForRepliesUninterruptibly();
}
if (logger.isDebugEnabled()) {
logger.debug("sending messages to all peers for removing this server..");
}
}
}
}
Aggregations