use of org.apache.geode.internal.cache.partitioned.DestroyMessage.DestroyResponse in project geode by apache.
the class PartitionedRegion method destroyRemotely.
/**
* Destroy the entry on the remote node.
*
* @param recipient the member id of the receiver of the message
* @param bucketId the idenity of the bucket
* @param event the event prompting this request
* @param expectedOldValue if not null, then destroy only if entry exists and current value is
* equal to expectedOldValue
* @throws EntryNotFoundException if entry not found OR if expectedOldValue is non-null and
* doesn't equal the current value
* @throws PrimaryBucketException if the bucket on that node is not the primary copy
* @throws ForceReattemptException if the peer is no longer available
*/
public void destroyRemotely(DistributedMember recipient, Integer bucketId, EntryEventImpl event, Object expectedOldValue) throws EntryNotFoundException, PrimaryBucketException, ForceReattemptException {
DestroyResponse response = DestroyMessage.send(recipient, this, event, expectedOldValue);
if (response != null) {
this.prStats.incPartitionMessagesSent();
try {
response.waitForCacheException();
event.setVersionTag(response.getVersionTag());
} catch (EntryNotFoundException enfe) {
throw enfe;
} catch (TransactionDataNotColocatedException enfe) {
throw enfe;
} catch (TransactionDataRebalancedException e) {
throw e;
} catch (CacheException ce) {
throw new PartitionedRegionException(LocalizedStrings.PartitionedRegion_DESTROY_OF_ENTRY_ON_0_FAILED.toLocalizedString(recipient), ce);
} catch (RegionDestroyedException ignore) {
throw new RegionDestroyedException(toString(), getFullPath());
}
}
}
Aggregations