/** * Sends a message to remove the bucket. * * @param recipient the member to remove the bucket from * @param region the PartitionedRegion of the bucket * @param bucketId the bucket to remove * @return the processor used to wait for the response */ public static RemoveBucketResponse send( InternalDistributedMember recipient, PartitionedRegion region, int bucketId, boolean forceRemovePrimary) { Assert.assertTrue(recipient != null, "RemoveBucketMessage NULL recipient"); RemoveBucketResponse response = new RemoveBucketResponse( region.getSystem(), recipient, region); RemoveBucketMessage msg = new RemoveBucketMessage( recipient, region.getPRId(), response, bucketId, forceRemovePrimary); 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 remove the bucket. * * @param recipient the member to remove the bucket from * @param region the PartitionedRegion of the bucket * @param bucketId the bucket to remove * @return the processor used to wait for the response */ public static RemoveBucketResponse send( InternalDistributedMember recipient, PartitionedRegion region, int bucketId, boolean forceRemovePrimary) { Assert.assertTrue(recipient != null, "RemoveBucketMessage NULL recipient"); RemoveBucketResponse response = new RemoveBucketResponse( region.getSystem(), recipient, region); RemoveBucketMessage msg = new RemoveBucketMessage( recipient, region.getPRId(), response, bucketId, forceRemovePrimary); 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; }
registerDSFID(PR_BECOME_PRIMARY_BUCKET_REPLY, () -> new BecomePrimaryBucketReplyMessage()); registerDSFID(PR_REMOVE_BUCKET_MESSAGE, () -> new RemoveBucketMessage());