protected EntryEventImpl generateCustomEvictDestroyEvent(final Object key) { EntryEventImpl event = EntryEventImpl.create( this, Operation.CUSTOM_EVICT_DESTROY, key, null/* newValue */, null, false, getMyId()); // Fix for bug#36963 if (generateEventID()) { event.setNewEventId(cache.getDistributedSystem()); } event.setFetchFromHDFS(false); return event; }
protected EntryEventImpl generateCustomEvictDestroyEvent(final Object key) { EntryEventImpl event = EntryEventImpl.create( this, Operation.CUSTOM_EVICT_DESTROY, key, null/* newValue */, null, false, getMyId()); // Fix for bug#36963 if (generateEventID()) { event.setNewEventId(cache.getDistributedSystem()); } event.setFetchFromHDFS(false); return event; }
/** * Creates an event for EVICT_DESTROY operations. * It is intended that this method be overridden to allow for special * handling of Partitioned Regions. * @param key - the key that this event is related to * @return an event for EVICT_DESTROY */ protected EntryEventImpl generateEvictDestroyEvent(final Object key) { EntryEventImpl event = EntryEventImpl.create( this, Operation.EVICT_DESTROY, key, null/* newValue */, null, false, getMyId()); // Fix for bug#36963 if (generateEventID()) { event.setNewEventId(cache.getDistributedSystem()); } event.setFetchFromHDFS(false); return event; }
/** * Creates an event for EVICT_DESTROY operations. * It is intended that this method be overridden to allow for special * handling of Partitioned Regions. * @param key - the key that this event is related to * @return an event for EVICT_DESTROY */ protected EntryEventImpl generateEvictDestroyEvent(final Object key) { EntryEventImpl event = EntryEventImpl.create( this, Operation.EVICT_DESTROY, key, null/* newValue */, null, false, getMyId()); // Fix for bug#36963 if (generateEventID()) { event.setNewEventId(cache.getDistributedSystem()); } event.setFetchFromHDFS(false); return event; } protected EntryEventImpl generateCustomEvictDestroyEvent(final Object key) {
/** * Destroys entry without performing validations. Call this after validating * key, callback arg, and runtime state. */ protected void validatedInvalidate(Object key, Object aCallbackArgument) throws TimeoutException, EntryNotFoundException { EntryEventImpl event = EntryEventImpl.create( this, Operation.INVALIDATE, key, null, aCallbackArgument, false, getMyId()); try { if (generateEventID()) { event.setNewEventId(cache.getDistributedSystem()); } basicInvalidate(event); } finally { event.release(); } }
/** * Destroys entry without performing validations. Call this after validating * key, callback arg, and runtime state. */ protected void validatedInvalidate(Object key, Object aCallbackArgument) throws TimeoutException, EntryNotFoundException { EntryEventImpl event = EntryEventImpl.create( this, Operation.INVALIDATE, key, null, aCallbackArgument, false, getMyId()); try { if (generateEventID()) { event.setNewEventId(cache.getDistributedSystem()); } basicInvalidate(event); } finally { event.release(); } }
@Override void basicUpdateEntryVersion(EntryEventImpl event) throws EntryNotFoundException { try { if (event.getEventId() == null) { event.setNewEventId(this.cache.getDistributedSystem()); } getDataView().updateEntryVersion(event); } catch (RegionDestroyedException rde) { if (!rde.getRegionFullPath().equals(getFullPath())) { // Handle when a bucket is destroyed RegionDestroyedException rde2 = new RegionDestroyedException(toString(), getFullPath()); rde2.initCause(rde); throw rde2; } } return; }
@Override void basicUpdateEntryVersion(EntryEventImpl event) throws EntryNotFoundException { try { if (event.getEventId() == null) { event.setNewEventId(this.cache.getDistributedSystem()); } getDataView().updateEntryVersion(event); } catch (RegionDestroyedException rde) { if (!rde.getRegionFullPath().equals(getFullPath())) { // Handle when a bucket is destroyed RegionDestroyedException rde2 = new RegionDestroyedException(toString(), getFullPath()); rde2.initCause(rde); throw rde2; } } return; }
private EntryEventImpl createNewEvent(LocalRegion region, VersionTag tag, Object key) { EntryEventImpl updateTimeStampEvent = EntryEventImpl.createVersionTagHolder(tag); updateTimeStampEvent.setOperation(Operation.UPDATE_VERSION_STAMP); updateTimeStampEvent.setRegion(region); if (region instanceof PartitionedRegion) { updateTimeStampEvent.setKeyInfo(((PartitionedRegion)region).getKeyInfo(key)); } else { updateTimeStampEvent.setKeyInfo(new KeyInfo(key, null, 0)); } updateTimeStampEvent.setGenerateCallbacks(false); updateTimeStampEvent.distributedMember = region.getSystem().getDistributedMember(); updateTimeStampEvent.setNewEventId(region.getSystem()); return updateTimeStampEvent; }
public void localInvalidate(Object key, Object callbackArgument) throws EntryNotFoundException { validateKey(key); checkReadiness(); checkForNoAccess(); EntryEventImpl event = EntryEventImpl.create( this, Operation.LOCAL_INVALIDATE, key, null/* newValue */, callbackArgument, false, getMyId()); try { if (generateEventID()) { event.setNewEventId(cache.getDistributedSystem()); } event.setLocalInvalid(true); basicInvalidate(event); } finally { event.release(); } }
@Override protected boolean localInvalidate() throws EntryNotFoundException { RegionEntry re = getCheckedRegionEntry(); Object key = re.getKeyCopy(); LocalRegion lr = getLocalRegion(); EntryEventImpl event = EntryEventImpl.create(lr, Operation.EXPIRE_LOCAL_INVALIDATE, key, null, createExpireEntryCallback(lr, key), false, lr.getMyId()); try { if (lr.generateEventID()) { event.setNewEventId(lr.getCache().getDistributedSystem()); } lr.expireInvalidate(event); } finally { event.release(); } return true; }
private EntryEventImpl createNewEvent(LocalRegion region, VersionTag tag, Object key, Object value) { EntryEventImpl updateEvent = EntryEventImpl.createVersionTagHolder(tag); updateEvent.setOperation(Operation.UPDATE); updateEvent.setRegion(region); if (region instanceof PartitionedRegion) { updateEvent.setKeyInfo(((PartitionedRegion)region).getKeyInfo(key)); } else { updateEvent.setKeyInfo(new KeyInfo(key, value, null)); } updateEvent.setNewValue(value); updateEvent.setGenerateCallbacks(true); updateEvent.distributedMember = region.getSystem().getDistributedMember(); updateEvent.setNewEventId(region.getSystem()); return updateEvent; }
@Override protected boolean invalidate() throws TimeoutException, EntryNotFoundException { RegionEntry re = getCheckedRegionEntry(); Object key = re.getKey(); LocalRegion lr = getLocalRegion(); EntryEventImpl event = EntryEventImpl.create(lr, Operation.EXPIRE_INVALIDATE, key, null, createExpireEntryCallback(lr, key), false, lr.getMyId()); try { if (lr.generateEventID()) { event.setNewEventId(lr.getCache().getDistributedSystem()); } lr.expireInvalidate(event); } finally { event.release(); } return true; }
@Override protected boolean localDestroy() throws CacheException { RegionEntry re = getCheckedRegionEntry(); Object key = re.getKeyCopy(); LocalRegion lr = getLocalRegion(); EntryEventImpl event = EntryEventImpl.create(lr, Operation.EXPIRE_LOCAL_DESTROY, key, null, createExpireEntryCallback(lr, key), false, lr.getMyId()); try { if (lr.generateEventID()) { event.setNewEventId(lr.getCache().getDistributedSystem()); } lr.expireDestroy(event, false); // expectedOldValue } finally { event.release(); } return true; }
@Override protected boolean localInvalidate() throws EntryNotFoundException { RegionEntry re = getCheckedRegionEntry(); Object key = re.getKey(); LocalRegion lr = getLocalRegion(); EntryEventImpl event = EntryEventImpl.create(lr, Operation.EXPIRE_LOCAL_INVALIDATE, key, null, createExpireEntryCallback(lr, key), false, lr.getMyId()); try { if (lr.generateEventID()) { event.setNewEventId(lr.getCache().getDistributedSystem()); } lr.expireInvalidate(event); } finally { event.release(); } return true; }
@Override protected boolean localDestroy() throws CacheException { RegionEntry re = getCheckedRegionEntry(); Object key = re.getKey(); LocalRegion lr = getLocalRegion(); EntryEventImpl event = EntryEventImpl.create(lr, Operation.EXPIRE_LOCAL_DESTROY, key, null, createExpireEntryCallback(lr, key), false, lr.getMyId()); try { if (lr.generateEventID()) { event.setNewEventId(lr.getCache().getDistributedSystem()); } lr.expireDestroy(event, false); // expectedOldValue } finally { event.release(); } return true; }
@Override protected boolean invalidate() throws TimeoutException, EntryNotFoundException { RegionEntry re = getCheckedRegionEntry(); Object key = re.getKeyCopy(); LocalRegion lr = getLocalRegion(); EntryEventImpl event = EntryEventImpl.create(lr, Operation.EXPIRE_INVALIDATE, key, null, createExpireEntryCallback(lr, key), false, lr.getMyId()); try { if (lr.generateEventID()) { event.setNewEventId(lr.getCache().getDistributedSystem()); } lr.expireInvalidate(event); } finally { event.release(); } return true; }
@Override protected boolean destroy(boolean isPending) throws CacheException { RegionEntry re = getCheckedRegionEntry(); Object key = re.getKey(); LocalRegion lr = getLocalRegion(); EntryEventImpl event = EntryEventImpl.create( lr, Operation.EXPIRE_DESTROY, key, null, createExpireEntryCallback(lr, key), false, lr.getMyId()); try { event.setPendingSecondaryExpireDestroy(isPending); if (lr.generateEventID()) { event.setNewEventId(lr.getCache().getDistributedSystem()); } lr.expireDestroy(event, true); // expectedOldValue return true; } finally { event.release(); } }
@Override protected boolean destroy(boolean isPending) throws CacheException { RegionEntry re = getCheckedRegionEntry(); Object key = re.getKeyCopy(); LocalRegion lr = getLocalRegion(); EntryEventImpl event = EntryEventImpl.create( lr, Operation.EXPIRE_DESTROY, key, null, createExpireEntryCallback(lr, key), false, lr.getMyId()); event.setPendingSecondaryExpireDestroy(isPending); try { if (lr.generateEventID()) { event.setNewEventId(lr.getCache().getDistributedSystem()); } lr.expireDestroy(event, true); // expectedOldValue return true; } finally { event.release(); } }
public void localInvalidate(Object key, Object callbackArgument) throws EntryNotFoundException { validateKey(key); checkReadiness(); checkForNoAccess(); EntryEventImpl event = EntryEventImpl.create( this, Operation.LOCAL_INVALIDATE, key, null/* newValue */, callbackArgument, false, getMyId()); try { operationStart(); if (generateEventID()) { event.setNewEventId(cache.getDistributedSystem()); } event.setLocalInvalid(true); basicInvalidate(event); } finally { event.release(); operationCompleted(); } }