Search in sources :

Example 56 with Released

use of org.apache.geode.internal.offheap.annotations.Released in project geode by apache.

the class LocalRegion method basicBridgeRemove.

// TODO: fromClient is always true
public void basicBridgeRemove(Object key, Object expectedOldValue, Object callbackArg, ClientProxyMembershipID memberId, boolean fromClient, EntryEventImpl clientEvent) throws TimeoutException, EntryNotFoundException, CacheWriterException {
    if (fromClient) {
        // GatewayEventCallbackArgument to store the event id.
        if (isGatewaySenderEnabled()) {
            callbackArg = new GatewaySenderEventCallbackArgument(callbackArg);
        }
    }
    // Create an event and put the entry
    @Released final EntryEventImpl event = EntryEventImpl.create(this, Operation.REMOVE, key, null, callbackArg, false, memberId.getDistributedMember(), true, clientEvent.getEventId());
    try {
        event.setContext(memberId);
        // place. AbstractRegionMap performs the checks and throws the exception
        try {
            basicDestroy(event, true, expectedOldValue);
        } finally {
            clientEvent.setVersionTag(event.getVersionTag());
            clientEvent.setIsRedestroyedEntry(event.getIsRedestroyedEntry());
        }
    } finally {
        event.release();
    }
}
Also used : Released(org.apache.geode.internal.offheap.annotations.Released) GatewaySenderEventCallbackArgument(org.apache.geode.internal.cache.wan.GatewaySenderEventCallbackArgument)

Example 57 with Released

use of org.apache.geode.internal.offheap.annotations.Released in project geode by apache.

the class LocalRegion method basicBridgeInvalidate.

// TODO: fromClient is always true
public void basicBridgeInvalidate(Object key, Object callbackArg, ClientProxyMembershipID memberId, boolean fromClient, EntryEventImpl clientEvent) throws TimeoutException, EntryNotFoundException, CacheWriterException {
    Object theCallbackArg = callbackArg;
    if (fromClient) {
        // GatewayEventCallbackArgument to store the event id.
        if (isGatewaySenderEnabled()) {
            theCallbackArg = new GatewaySenderEventCallbackArgument(theCallbackArg);
        }
    }
    // Create an event and put the entry
    @Released final EntryEventImpl event = EntryEventImpl.create(this, Operation.INVALIDATE, key, null, theCallbackArg, false, memberId.getDistributedMember(), true, clientEvent.getEventId());
    try {
        event.setContext(memberId);
        // if this is a replayed operation we may already have a version tag
        event.setVersionTag(clientEvent.getVersionTag());
        try {
            basicInvalidate(event);
        } finally {
            clientEvent.setVersionTag(event.getVersionTag());
            clientEvent.isConcurrencyConflict(event.isConcurrencyConflict());
        }
    } finally {
        event.release();
    }
}
Also used : Released(org.apache.geode.internal.offheap.annotations.Released) StoredObject(org.apache.geode.internal.offheap.StoredObject) GatewaySenderEventCallbackArgument(org.apache.geode.internal.cache.wan.GatewaySenderEventCallbackArgument)

Aggregations

Released (org.apache.geode.internal.offheap.annotations.Released)57 StoredObject (org.apache.geode.internal.offheap.StoredObject)29 CacheWriterException (org.apache.geode.cache.CacheWriterException)13 EntryNotFoundException (org.apache.geode.cache.EntryNotFoundException)13 InternalDistributedMember (org.apache.geode.distributed.internal.membership.InternalDistributedMember)12 ConcurrentCacheModificationException (org.apache.geode.internal.cache.versions.ConcurrentCacheModificationException)9 GatewaySenderEventCallbackArgument (org.apache.geode.internal.cache.wan.GatewaySenderEventCallbackArgument)9 Retained (org.apache.geode.internal.offheap.annotations.Retained)9 EntryEventImpl (org.apache.geode.internal.cache.EntryEventImpl)8 VersionedObjectList (org.apache.geode.internal.cache.tier.sockets.VersionedObjectList)8 DiskAccessException (org.apache.geode.cache.DiskAccessException)6 Operation (org.apache.geode.cache.Operation)6 ReplyException (org.apache.geode.distributed.internal.ReplyException)6 RegionDestroyedException (org.apache.geode.cache.RegionDestroyedException)5 IndexManager (org.apache.geode.cache.query.internal.index.IndexManager)5 PartitionedRegionDataStore (org.apache.geode.internal.cache.PartitionedRegionDataStore)5 TimeoutException (org.apache.geode.cache.TimeoutException)4 EventID (org.apache.geode.internal.cache.EventID)4 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3