Search in sources :

Example 1 with DestroyResponse

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());
        }
    }
}
Also used : CacheException(org.apache.geode.cache.CacheException) DestroyResponse(org.apache.geode.internal.cache.partitioned.DestroyMessage.DestroyResponse) TransactionDataNotColocatedException(org.apache.geode.cache.TransactionDataNotColocatedException) RegionDestroyedException(org.apache.geode.cache.RegionDestroyedException) EntryNotFoundException(org.apache.geode.cache.EntryNotFoundException) TransactionDataRebalancedException(org.apache.geode.cache.TransactionDataRebalancedException)

Aggregations

CacheException (org.apache.geode.cache.CacheException)1 EntryNotFoundException (org.apache.geode.cache.EntryNotFoundException)1 RegionDestroyedException (org.apache.geode.cache.RegionDestroyedException)1 TransactionDataNotColocatedException (org.apache.geode.cache.TransactionDataNotColocatedException)1 TransactionDataRebalancedException (org.apache.geode.cache.TransactionDataRebalancedException)1 DestroyResponse (org.apache.geode.internal.cache.partitioned.DestroyMessage.DestroyResponse)1