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();
}
}
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();
}
}
Aggregations