@Override protected final boolean localDestroy() throws CacheException { LocalRegion lr = getLocalRegion(); RegionEventImpl event = new RegionEventImpl(lr, Operation.REGION_EXPIRE_LOCAL_DESTROY, null, false, lr.getMyId(), lr.generateEventID() /* generate EventID */); lr.basicDestroyRegion(event, false); return true; }
@Override protected final boolean destroy(boolean isPending) throws CacheException { LocalRegion lr = getLocalRegion(); RegionEventImpl event = new RegionEventImpl(lr, Operation.REGION_EXPIRE_DESTROY, null, false, lr.getMyId(), lr.generateEventID() /* generate EventID */); lr.basicDestroyRegion(event, true); return true; }
public void close(RegionEventImpl event) { try { // NOTE: the 422dynamicRegions branch added the callbackEvents argument // to basicDestroyRegion and inhibited events on region.close. This // clashed with the new SystemMemberCacheListener functionality in // 5.0, causing unit tests to fail basicDestroyRegion(event, false, true, true); } catch (CacheWriterException e) { // not possible with local operation, CacheWriter not called throw new Error(LocalizedStrings.LocalRegion_CACHEWRITEREXCEPTION_SHOULD_NOT_BE_THROWN_IN_LOCALDESTROYREGION.toLocalizedString(), e); } catch (TimeoutException e) { // not possible with local operation, no distributed locks possible throw new Error(LocalizedStrings.LocalRegion_TIMEOUTEXCEPTION_SHOULD_NOT_BE_THROWN_IN_LOCALDESTROYREGION.toLocalizedString(), e); } }
public void localDestroyRegion(Object aCallbackArgument) { getDataView().checkSupportsRegionDestroy(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_LOCAL_DESTROY, aCallbackArgument, false, getMyId(), generateEventID()/* generate EventID */); try { basicDestroyRegion(event, false); } catch (CacheWriterException e) { // not possible with local operation, CacheWriter not called throw new Error(LocalizedStrings.LocalRegion_CACHEWRITEREXCEPTION_SHOULD_NOT_BE_THROWN_IN_LOCALDESTROYREGION.toLocalizedString(), e); } catch (TimeoutException e) { // not possible with local operation, no distributed locks possible throw new Error(LocalizedStrings.LocalRegion_TIMEOUTEXCEPTION_SHOULD_NOT_BE_THROWN_IN_LOCALDESTROYREGION.toLocalizedString(), e); } }
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; }
public void localDestroyRegion(Object aCallbackArgument) { getDataView().checkSupportsRegionDestroy(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_LOCAL_DESTROY, aCallbackArgument, false, getMyId(), generateEventID()/* generate EventID */); try { basicDestroyRegion(event, false); } catch (CacheWriterException e) { // not possible with local operation, CacheWriter not called throw new Error(LocalizedStrings.LocalRegion_CACHEWRITEREXCEPTION_SHOULD_NOT_BE_THROWN_IN_LOCALDESTROYREGION.toLocalizedString(), e); } catch (TimeoutException e) { // not possible with local operation, no distributed locks possible throw new Error(LocalizedStrings.LocalRegion_TIMEOUTEXCEPTION_SHOULD_NOT_BE_THROWN_IN_LOCALDESTROYREGION.toLocalizedString(), e); } }
public void destroyRegion(Object aCallbackArgument) throws CacheWriterException, TimeoutException { getDataView().checkSupportsRegionDestroy(); checkForLimitedOrNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_DESTROY, aCallbackArgument, false, getMyId(), generateEventID()); basicDestroyRegion(event, true); }
public void destroyRegion(Object aCallbackArgument) throws CacheWriterException, TimeoutException { getDataView().checkSupportsRegionDestroy(); checkForLimitedOrNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_DESTROY, aCallbackArgument, false, getMyId(), generateEventID()); basicDestroyRegion(event, true); }
public void loadSnapshot(InputStream inputStream) throws CacheWriterException, TimeoutException, ClassNotFoundException, IOException { if (isProxy()) { throw new UnsupportedOperationException(LocalizedStrings.LocalRegion_REGIONS_WITH_DATAPOLICY_0_DO_NOT_SUPPORT_LOADSNAPSHOT.toLocalizedString(getDataPolicy())); } if (inputStream == null) { throw new NullPointerException(LocalizedStrings.LocalRegion_INPUTSTREAM_MUST_NOT_BE_NULL.toLocalizedString()); } checkReadiness(); checkForLimitedOrNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_LOAD_SNAPSHOT, null, false, getMyId(), generateEventID()/* generate EventID */); reinitialize(inputStream, event); }
public void loadSnapshot(InputStream inputStream) throws CacheWriterException, TimeoutException, ClassNotFoundException, IOException { if (isProxy()) { throw new UnsupportedOperationException(LocalizedStrings.LocalRegion_REGIONS_WITH_DATAPOLICY_0_DO_NOT_SUPPORT_LOADSNAPSHOT.toLocalizedString(getDataPolicy())); } if (inputStream == null) { throw new NullPointerException(LocalizedStrings.LocalRegion_INPUTSTREAM_MUST_NOT_BE_NULL.toLocalizedString()); } checkReadiness(); checkForLimitedOrNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_LOAD_SNAPSHOT, null, false, getMyId(), generateEventID()/* generate EventID */); reinitialize(inputStream, 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; }
/** * 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(); } }
public void invalidateRegion(Object aCallbackArgument) throws TimeoutException { getDataView().checkSupportsRegionInvalidate(); validateCallbackArg(aCallbackArgument); checkReadiness(); checkForLimitedOrNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_INVALIDATE, aCallbackArgument, false, getMyId(), generateEventID()); basicInvalidateRegion(event); }
public void invalidateRegion(Object aCallbackArgument) throws TimeoutException { getDataView().checkSupportsRegionInvalidate(); validateCallbackArg(aCallbackArgument); checkReadiness(); checkForLimitedOrNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_INVALIDATE, aCallbackArgument, false, getMyId(), generateEventID()); basicInvalidateRegion(event); }
@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; }
@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 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; }