public DeposePrimaryBucketMessage(DataInput in) throws IOException, ClassNotFoundException { fromData(in); }
@Override protected final boolean operateOnPartitionedRegion(DistributionManager dm, PartitionedRegion region, long startTime) throws ForceReattemptException { BucketAdvisor bucketAdvisor = region.getRegionAdvisor().getBucketAdvisor(this.bucketId); bucketAdvisor.deposePrimary(); region.getPrStats().endPartitionMessagesProcessing(startTime); DeposePrimaryBucketReplyMessage.send( getSender(), getProcessorId(), dm, (ReplyException)null); return false; }
public Object call() { PartitionedRegion pr = (PartitionedRegion) getCache().getRegion(regionPath[0]); InternalDistributedMember primaryMember = pr.getRegionAdvisor().getBucketAdvisor(0).getPrimary(); DeposePrimaryBucketResponse response = DeposePrimaryBucketMessage.send(primaryMember, pr, 0); if (response != null) { response.waitForRepliesUninterruptibly(); return true; } else { return Boolean.FALSE; } } })).booleanValue();
/** * Sends a message to depose the primary bucket. * * @param recipient the member to depose as primary * @param region the PartitionedRegion of the bucket * @param bucketId the bucket to depose primary for * @return the processor used to wait for the response */ public static DeposePrimaryBucketResponse send( InternalDistributedMember recipient, PartitionedRegion region, int bucketId) { Assert.assertTrue(recipient != null, "DeposePrimaryBucketMessage NULL recipient"); DeposePrimaryBucketResponse response = new DeposePrimaryBucketResponse( region.getSystem(), recipient, region); DeposePrimaryBucketMessage msg = new DeposePrimaryBucketMessage( recipient, region.getPRId(), response, bucketId); Set<InternalDistributedMember> failures = region.getDistributionManager().putOutgoing(msg); if (failures != null && failures.size() > 0) { //throw new ForceReattemptException("Failed sending <" + msg + ">"); return null; } region.getPrStats().incPartitionMessagesSent(); return response; }
@Override protected final boolean operateOnPartitionedRegion(DistributionManager dm, PartitionedRegion region, long startTime) throws ForceReattemptException { BucketAdvisor bucketAdvisor = region.getRegionAdvisor().getBucketAdvisor(this.bucketId); bucketAdvisor.deposePrimary(); region.getPrStats().endPartitionMessagesProcessing(startTime); DeposePrimaryBucketReplyMessage.send( getSender(), getProcessorId(), dm, (ReplyException)null); return false; }
DeposePrimaryBucketMessage.send( otherPrimary, this.pRegion,
/** * Sends a message to depose the primary bucket. * * @param recipient the member to depose as primary * @param region the PartitionedRegion of the bucket * @param bucketId the bucket to depose primary for * @return the processor used to wait for the response */ public static DeposePrimaryBucketResponse send( InternalDistributedMember recipient, PartitionedRegion region, int bucketId) { Assert.assertTrue(recipient != null, "DeposePrimaryBucketMessage NULL recipient"); DeposePrimaryBucketResponse response = new DeposePrimaryBucketResponse( region.getSystem(), recipient, region); DeposePrimaryBucketMessage msg = new DeposePrimaryBucketMessage( recipient, region.getPRId(), response, bucketId); Set<InternalDistributedMember> failures = region.getDistributionManager().putOutgoing(msg); if (failures != null && failures.size() > 0) { //throw new ForceReattemptException("Failed sending <" + msg + ">"); return null; } region.getPrStats().incPartitionMessagesSent(); return response; }
DeposePrimaryBucketMessage.send( otherPrimary, this.pRegion,
() -> new FetchPartitionDetailsReplyMessage()); registerDSFID(PR_DEPOSE_PRIMARY_BUCKET_MESSAGE, () -> new DeposePrimaryBucketMessage()); registerDSFID(PR_DEPOSE_PRIMARY_BUCKET_REPLY, () -> new DeposePrimaryBucketReplyMessage());
public DeposePrimaryBucketMessage(DataInput in) throws IOException, ClassNotFoundException { fromData(in); }