use of org.apache.geode.internal.cache.DestroyPartitionedRegionMessage.DestroyPartitionedRegionResponse in project geode by apache.
the class PartitionedRegion method sendDestroyRegionMessage.
/**
* Sends the partitioned region specific destroy region message and waits for any responses. This
* message is also sent in close/localDestroyRegion operation. When it is sent in Cache
* close/Region close/localDestroyRegion operations, it results in updating of RegionAdvisor on
* recipient nodes.
*
* @param event the destruction event
* @param serials the bucket serials hosted locally
* @see Region#destroyRegion()
* @see Region#close()
* @see Region#localDestroyRegion()
* @see GemFireCacheImpl#close()
*/
private void sendDestroyRegionMessage(RegionEventImpl event, int[] serials) {
if (this.prRoot == null) {
if (logger.isDebugEnabled()) {
logger.debug("Partition region {} failed to initialize. Remove its profile from remote members.", this);
}
new UpdateAttributesProcessor(this, true).distribute(false);
return;
}
final HashSet configRecipients = new HashSet(getRegionAdvisor().adviseAllPRNodes());
// sent a CreateRegionProcessor message, bug 36048
try {
final PartitionRegionConfig prConfig = this.prRoot.get(getRegionIdentifier());
if (prConfig != null) {
// Fix for bug#34621 by Tushar
Iterator itr = prConfig.getNodes().iterator();
while (itr.hasNext()) {
InternalDistributedMember idm = ((Node) itr.next()).getMemberId();
if (!idm.equals(getMyId())) {
configRecipients.add(idm);
}
}
}
} catch (CancelException ignore) {
// ignore
}
try {
DestroyPartitionedRegionResponse resp = DestroyPartitionedRegionMessage.send(configRecipients, this, event, serials);
resp.waitForRepliesUninterruptibly();
} catch (ReplyException e) {
logger.warn(LocalizedMessage.create(LocalizedStrings.PartitionedRegion_PARTITIONEDREGION_SENDDESTROYREGIONMESSAGE_CAUGHT_EXCEPTION_DURING_DESTROYREGIONMESSAGE_SEND_AND_WAITING_FOR_RESPONSE), e);
}
}
Aggregations