/** * 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; }
/** * 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; }
() -> new FetchPartitionDetailsReplyMessage()); registerDSFID(PR_DEPOSE_PRIMARY_BUCKET_MESSAGE, () -> new DeposePrimaryBucketMessage()); registerDSFID(PR_DEPOSE_PRIMARY_BUCKET_REPLY, () -> new DeposePrimaryBucketReplyMessage());