Search in sources :

Example 1 with RemoteOperationException

use of org.apache.geode.internal.cache.RemoteOperationException in project geode by apache.

the class DistributedTXRegionStub method destroyExistingEntry.

public void destroyExistingEntry(EntryEventImpl event, boolean cacheWrite, Object expectedOldValue) {
    // this.prStats.incPartitionMessagesSent();
    try {
        RemoteOperationResponse response = RemoteDestroyMessage.send(state.getTarget(), event.getLocalRegion(), event, expectedOldValue, DistributionManager.PARTITIONED_REGION_EXECUTOR, true, false);
        response.waitForCacheException();
    } catch (EntryNotFoundException enfe) {
        throw enfe;
    } catch (TransactionDataNotColocatedException enfe) {
        throw enfe;
    } catch (CacheException ce) {
        throw new PartitionedRegionException(LocalizedStrings.PartitionedRegion_DESTROY_OF_ENTRY_ON_0_FAILED.toLocalizedString(state.getTarget()), ce);
    } catch (RegionDestroyedException rde) {
        throw new TransactionDataNotColocatedException(LocalizedStrings.RemoteMessage_REGION_0_NOT_COLOCATED_WITH_TRANSACTION.toLocalizedString(rde.getRegionFullPath()), rde);
    } catch (RemoteOperationException roe) {
        throw new TransactionDataNodeHasDepartedException(roe);
    }
}
Also used : PartitionedRegionException(org.apache.geode.internal.cache.PartitionedRegionException) CacheException(org.apache.geode.cache.CacheException) TransactionDataNotColocatedException(org.apache.geode.cache.TransactionDataNotColocatedException) RegionDestroyedException(org.apache.geode.cache.RegionDestroyedException) RemoteOperationException(org.apache.geode.internal.cache.RemoteOperationException) EntryNotFoundException(org.apache.geode.cache.EntryNotFoundException) RemoteOperationResponse(org.apache.geode.internal.cache.RemoteOperationMessage.RemoteOperationResponse) TransactionDataNodeHasDepartedException(org.apache.geode.cache.TransactionDataNodeHasDepartedException)

Example 2 with RemoteOperationException

use of org.apache.geode.internal.cache.RemoteOperationException in project geode by apache.

the class DistributedTXRegionStub method putEntry.

public boolean putEntry(EntryEventImpl event, boolean ifNew, boolean ifOld, Object expectedOldValue, boolean requireOldValue, long lastModified, boolean overwriteDestroyed) {
    boolean retVal = false;
    final LocalRegion r = event.getLocalRegion();
    try {
        RemotePutResponse response = RemotePutMessage.txSend(state.getTarget(), r, event, lastModified, ifNew, ifOld, expectedOldValue, requireOldValue);
        PutResult result = response.waitForResult();
        event.setOldValue(result.oldValue, true);
        retVal = result.returnValue;
    } catch (TransactionDataNotColocatedException enfe) {
        throw enfe;
    } catch (CacheException ce) {
        throw new PartitionedRegionException(LocalizedStrings.PartitionedRegion_DESTROY_OF_ENTRY_ON_0_FAILED.toLocalizedString(state.getTarget()), ce);
    } catch (RegionDestroyedException rde) {
        throw new TransactionDataNotColocatedException(LocalizedStrings.RemoteMessage_REGION_0_NOT_COLOCATED_WITH_TRANSACTION.toLocalizedString(rde.getRegionFullPath()), rde);
    } catch (RemoteOperationException roe) {
        throw new TransactionDataNodeHasDepartedException(roe);
    }
    return retVal;
}
Also used : PartitionedRegionException(org.apache.geode.internal.cache.PartitionedRegionException) CacheException(org.apache.geode.cache.CacheException) TransactionDataNotColocatedException(org.apache.geode.cache.TransactionDataNotColocatedException) RegionDestroyedException(org.apache.geode.cache.RegionDestroyedException) RemoteOperationException(org.apache.geode.internal.cache.RemoteOperationException) RemotePutResponse(org.apache.geode.internal.cache.RemotePutMessage.RemotePutResponse) LocalRegion(org.apache.geode.internal.cache.LocalRegion) PutResult(org.apache.geode.internal.cache.RemotePutMessage.PutResult) TransactionDataNodeHasDepartedException(org.apache.geode.cache.TransactionDataNodeHasDepartedException)

Example 3 with RemoteOperationException

use of org.apache.geode.internal.cache.RemoteOperationException in project geode by apache.

the class DistributedTXRegionStub method findObject.

public Object findObject(KeyInfo keyInfo, boolean isCreate, boolean generateCallbacks, Object value, boolean preferCD, ClientProxyMembershipID requestingClient, EntryEventImpl clientEvent) {
    Object retVal = null;
    final Object key = keyInfo.getKey();
    final Object callbackArgument = keyInfo.getCallbackArg();
    try {
        RemoteGetMessage.RemoteGetResponse response = RemoteGetMessage.send((InternalDistributedMember) state.getTarget(), region, key, callbackArgument, requestingClient);
        retVal = response.waitForResponse(preferCD);
    } catch (RegionDestroyedException rde) {
        throw new TransactionDataNotColocatedException(LocalizedStrings.RemoteMessage_REGION_0_NOT_COLOCATED_WITH_TRANSACTION.toLocalizedString(rde.getRegionFullPath()), rde);
    } catch (RemoteOperationException roe) {
        throw new TransactionDataNodeHasDepartedException(roe);
    }
    return retVal;
}
Also used : RegionDestroyedException(org.apache.geode.cache.RegionDestroyedException) TransactionDataNotColocatedException(org.apache.geode.cache.TransactionDataNotColocatedException) RemoteOperationException(org.apache.geode.internal.cache.RemoteOperationException) RemoteGetMessage(org.apache.geode.internal.cache.RemoteGetMessage) TransactionDataNodeHasDepartedException(org.apache.geode.cache.TransactionDataNodeHasDepartedException)

Example 4 with RemoteOperationException

use of org.apache.geode.internal.cache.RemoteOperationException in project geode by apache.

the class DistributedTXRegionStub method postPutAll.

public void postPutAll(DistributedPutAllOperation putallOp, VersionedObjectList successfulPuts, LocalRegion region) {
    try {
        RemotePutAllMessage.PutAllResponse response = RemotePutAllMessage.send(state.getTarget(), putallOp.getBaseEvent(), putallOp.getPutAllEntryData(), putallOp.getPutAllEntryData().length, true, DistributionManager.PARTITIONED_REGION_EXECUTOR, false);
        response.waitForCacheException();
    } catch (RegionDestroyedException rde) {
        throw new TransactionDataNotColocatedException(LocalizedStrings.RemoteMessage_REGION_0_NOT_COLOCATED_WITH_TRANSACTION.toLocalizedString(rde.getRegionFullPath()), rde);
    } catch (RemoteOperationException roe) {
        throw new TransactionDataNodeHasDepartedException(roe);
    }
}
Also used : RemotePutAllMessage(org.apache.geode.internal.cache.RemotePutAllMessage) RegionDestroyedException(org.apache.geode.cache.RegionDestroyedException) TransactionDataNotColocatedException(org.apache.geode.cache.TransactionDataNotColocatedException) RemoteOperationException(org.apache.geode.internal.cache.RemoteOperationException) TransactionDataNodeHasDepartedException(org.apache.geode.cache.TransactionDataNodeHasDepartedException)

Example 5 with RemoteOperationException

use of org.apache.geode.internal.cache.RemoteOperationException in project geode by apache.

the class DistributedTXRegionStub method postRemoveAll.

@Override
public void postRemoveAll(DistributedRemoveAllOperation op, VersionedObjectList successfulOps, LocalRegion region) {
    try {
        RemoteRemoveAllMessage.RemoveAllResponse response = RemoteRemoveAllMessage.send(state.getTarget(), op.getBaseEvent(), op.getRemoveAllEntryData(), op.getRemoveAllEntryData().length, true, DistributionManager.PARTITIONED_REGION_EXECUTOR, false);
        response.waitForCacheException();
    } catch (RegionDestroyedException rde) {
        throw new TransactionDataNotColocatedException(LocalizedStrings.RemoteMessage_REGION_0_NOT_COLOCATED_WITH_TRANSACTION.toLocalizedString(rde.getRegionFullPath()), rde);
    } catch (RemoteOperationException roe) {
        throw new TransactionDataNodeHasDepartedException(roe);
    }
}
Also used : RemoteRemoveAllMessage(org.apache.geode.internal.cache.RemoteRemoveAllMessage) RegionDestroyedException(org.apache.geode.cache.RegionDestroyedException) TransactionDataNotColocatedException(org.apache.geode.cache.TransactionDataNotColocatedException) RemoteOperationException(org.apache.geode.internal.cache.RemoteOperationException) TransactionDataNodeHasDepartedException(org.apache.geode.cache.TransactionDataNodeHasDepartedException)

Aggregations

RegionDestroyedException (org.apache.geode.cache.RegionDestroyedException)6 TransactionDataNodeHasDepartedException (org.apache.geode.cache.TransactionDataNodeHasDepartedException)6 TransactionDataNotColocatedException (org.apache.geode.cache.TransactionDataNotColocatedException)6 RemoteOperationException (org.apache.geode.internal.cache.RemoteOperationException)6 CacheException (org.apache.geode.cache.CacheException)2 PartitionedRegionException (org.apache.geode.internal.cache.PartitionedRegionException)2 RemoteOperationResponse (org.apache.geode.internal.cache.RemoteOperationMessage.RemoteOperationResponse)2 EntryNotFoundException (org.apache.geode.cache.EntryNotFoundException)1 LocalRegion (org.apache.geode.internal.cache.LocalRegion)1 RemoteGetMessage (org.apache.geode.internal.cache.RemoteGetMessage)1 RemotePutAllMessage (org.apache.geode.internal.cache.RemotePutAllMessage)1 PutResult (org.apache.geode.internal.cache.RemotePutMessage.PutResult)1 RemotePutResponse (org.apache.geode.internal.cache.RemotePutMessage.RemotePutResponse)1 RemoteRemoveAllMessage (org.apache.geode.internal.cache.RemoteRemoveAllMessage)1