@Override public void remoteRegionInitialized(CacheProfile profile) { synchronized (this.advisorListener) { if (this.advisorListener.members == null && hasListener()) { Object callback = TEST_HOOK_ADD_PROFILE ? profile : null; RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_CREATE, callback, true, profile.peerMemberId); dispatchListenerEvent(EnumListenerEvent.AFTER_REMOTE_REGION_CREATE, event); } } }
public void handleMarker() { RegionEventImpl event = new RegionEventImpl(this, Operation.MARKER, null, false, getMyId(), false /* generate EventID */); dispatchListenerEvent(EnumListenerEvent.AFTER_REGION_LIVE, event); }
protected RegionEventImpl createRegionEvent(DistributedRegion rgn) { return new RegionEventImpl(rgn, getOperation(), this.callbackArg, true /* originRemote */, getSender()); }
/** * This method is overriden so as to make isOriginRemote true always so that the operation is * never propagated to other nodes * * @see org.apache.geode.internal.cache.AbstractRegion#destroyRegion() */ @Override public void destroyRegion(Object aCallbackArgument) throws CacheWriterException, TimeoutException { // Do not generate EventID RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_DESTROY, aCallbackArgument, true /* isOriginRemote */, getMyId()); basicDestroyRegion(event, true); }
public static DistributedTombstoneOperation gc(DistributedRegion region, EventID eventId) { RegionEventImpl rev = new RegionEventImpl(region, Operation.REGION_EXPIRE_DESTROY, null, false, region.getMyId()); rev.setEventID(eventId); DistributedTombstoneOperation top = new DistributedTombstoneOperation(rev); top.op = TOperation.GC; return top; }
protected RegionEventImpl createRegionEvent(DistributedRegion rgn) { RegionEventImpl event = new RegionEventImpl(rgn, getOperation(), this.callbackArg, true /* originRemote */, getSender()); event.setVersionTag(this.operationTag); return event; }
@Override public void remoteRegionInitialized(CacheProfile profile) { if (isInitialized() && hasListener()) { Object callback = DistributedRegion.TEST_HOOK_ADD_PROFILE ? profile : null; RegionEventImpl event = new RegionEventImpl(PartitionedRegion.this, Operation.REGION_CREATE, callback, true, profile.peerMemberId); dispatchListenerEvent(EnumListenerEvent.AFTER_REMOTE_REGION_CREATE, event); } }
protected RegionEventImpl createRegionEvent(DistributedRegion rgn) { RegionEventImpl event = new RegionEventImpl(rgn, getOperation(), this.callbackArg, true /* originRemote */, getSender()); event.setEventID(this.eventID); return event; }
@Override 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( "CacheWriterException should not be thrown in localDestroyRegion", e); } catch (TimeoutException e) { // not possible with local operation, no distributed locks possible throw new Error( "TimeoutException should not be thrown in localDestroyRegion", e); } }
@Override public void loadSnapshot(InputStream inputStream) throws CacheWriterException, TimeoutException, ClassNotFoundException, IOException { if (isProxy()) { throw new UnsupportedOperationException( String.format("Regions with DataPolicy %s do not support loadSnapshot.", getDataPolicy())); } if (inputStream == null) { throw new NullPointerException( "InputStream must not be null."); } checkReadiness(); checkForLimitedOrNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_LOAD_SNAPSHOT, null, false, getMyId(), generateEventID()/* generate EventID */); reinitialize(inputStream, event); }
@Override public void clear() { checkReadiness(); checkForLimitedOrNoAccess(); RegionEventImpl regionEvent = new RegionEventImpl(this, Operation.REGION_CLEAR, null, false, getMyId(), generateEventID()); basicClear(regionEvent); }
@Override public void localClear() { checkReadiness(); checkForNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_LOCAL_CLEAR, null, false, getMyId(), generateEventID()/* generate EventID */); basicLocalClear(event); }
@Override protected boolean operateOnPartitionedRegion(ClusterDistributionManager dm, PartitionedRegion pr, long startTime) throws CacheException, QueryException, ForceReattemptException, InterruptedException { RegionEventImpl event = new RegionEventImpl(pr, Operation.REGION_INVALIDATE, this.callbackArg, !dm.getId().equals(getSender()), getSender()); pr.basicInvalidateRegion(event); return true; }
@Override public void cleanupFailedInitialization() { super.cleanupFailedInitialization(); try { RegionEventImpl ev = new RegionEventImpl(this, Operation.REGION_CLOSE, null, false, getMyId(), generateEventID()); distributeDestroyRegion(ev, true); distributedRegionCleanup(null); } catch (RegionDestroyedException ignore) { // someone else must have concurrently destroyed the region (maybe a distributed destroy) } catch (CancelException ignore) { // cache or DS is closed, ignore } catch (VirtualMachineError e) { SystemFailure.initiateFailure(e); throw e; } catch (Throwable t) { logger.warn("Error cleaning up after failed region initialization of region " + this, t); } }
@Override protected InternalCacheEvent createEvent(DistributedRegion rgn) throws EntryNotFoundException { RegionEventImpl event = new RegionEventImpl(rgn, getOperation(), this.callbackArg, true, getSender()); event.setEventID(this.eventID); if (this.filterRouting != null) { event.setLocalFilterInfo( this.filterRouting.getFilterInfo((InternalDistributedMember) rgn.getMyId())); } return event; }
@Override public void localInvalidateRegion(Object aCallbackArgument) { getDataView().checkSupportsRegionInvalidate(); checkReadiness(); checkForNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_LOCAL_INVALIDATE, aCallbackArgument, false, getMyId()); basicInvalidateRegion(event); }
@Override protected boolean operateOnPartitionedRegion(final ClusterDistributionManager dm, PartitionedRegion r, long startTime) throws ForceReattemptException { if (logger.isTraceEnabled(LogMarker.DM_VERBOSE)) { logger.trace("PRTombstoneMessage operateOnRegion: {}", r.getFullPath()); } FilterProfile fp = r.getFilterProfile(); if (this.keys != null && this.keys.size() > 0) { // sanity check if (fp != null && CacheClientNotifier.getInstance() != null && this.eventID != null) { RegionEventImpl regionEvent = new RegionEventImpl(r, Operation.REGION_DESTROY, null, true, r.getGemFireCache().getMyId()); regionEvent.setLocalFilterInfo(fp.getLocalFilterRouting(regionEvent)); ClientUpdateMessage clientMessage = ClientTombstoneMessage.gc(r, this.keys, this.eventID); CacheClientNotifier.notifyClients(regionEvent, clientMessage); } } return true; }
@Override public void invalidateRegion(Object aCallbackArgument) throws TimeoutException { getDataView().checkSupportsRegionInvalidate(); checkReadiness(); checkForLimitedOrNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_INVALIDATE, aCallbackArgument, false, getMyId(), generateEventID()); basicInvalidateRegion(event); }
@Override public void destroyRegion(Object aCallbackArgument) throws CacheWriterException, TimeoutException { this.cache.invokeBeforeDestroyed(this); getDataView().checkSupportsRegionDestroy(); checkForLimitedOrNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_DESTROY, aCallbackArgument, false, getMyId(), generateEventID()); basicDestroyRegion(event, true); }
@Override public void destroyRegion(Object aCallbackArgument) throws CacheWriterException, TimeoutException { this.cache.invokeBeforeDestroyed(this); checkForColocatedChildren(); getDataView().checkSupportsRegionDestroy(); checkForLimitedOrNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_DESTROY, aCallbackArgument, false, getMyId(), generateEventID()); basicDestroyRegion(event, true); }