@Override protected void appendFields(StringBuilder buff) { super.appendFields(buff); buff.append("; context=").append(this.context); }
advisee.getDistributionAdvisor().removeIdWithSerial(getSender(), serialNum, isDestroy); } else if (logger.isDebugEnabled()) { final LocalRegion lr = getRegionFromPath(dm, lclRgn.getFullPath()); if (lr == null) { if (logger.isDebugEnabled()) InternalCacheEvent event = createEvent(rgn); if (DestroyRegionMessage.this.needsRouting && lclRgn.cache.getCacheServers().size() > 0) { doRegionDestroy(event); } catch (RegionDestroyedException ignore) { logger.debug("{} Region destroyed: nothing to do", this); rex = new ReplyException(thr); sendReply(getSender(), DestroyRegionMessage.this.processorId, rex, getReplySender(dm));
/** Return true if a reply should be sent */ @Override protected void basicProcess(final ClusterDistributionManager dm, final LocalRegion lclRgn) { Assert.assertTrue(this.serialNum != DistributionAdvisor.ILLEGAL_SERIAL); try { this.lockRoot = null; // may set lockRoot to the root region where destroyLock is acquired final boolean sendReply = true; // Part of fix for bug 34450 which was caused by a PR destroy region op // dead-locked with // a PR create region op. The create region op required an entry update // to release a // DLock needed by the PR destroy.. by moving the destroy to the waiting // pool, the entry // update is allowed to complete. dm.getWaitingThreadPool().execute(destroyOp(dm, lclRgn, sendReply)); } catch (RejectedExecutionException ignore) { // rejected while trying to execute destroy thread // must be shutting down, just quit } }
final DistributedRegion rgn = (DistributedRegion) ev.region; if (getOperation().isLocal()) { Assert.assertTrue(serialNum != DistributionAdvisor.ILLEGAL_SERIAL); disableRegionDepartureNotification(); try { rgn.handleRemoteLocalRegionDestroyOrClose(getSender(), serialNum, subregionSerialNumbers, !getOperation().isClose()); } finally { enableRegionDepartureNotification(); fullPath, subregionNames); if (getOperation() == Operation.REGION_LOAD_SNAPSHOT) { if (logger.isDebugEnabled()) { logger.debug("Processing DestroyRegionOperation, calling reinitialize_destroy: {}",
protected LocalRegion getRegionFromPath(ClusterDistributionManager dm, String path) { // allow a destroyed region to be returned if we're dealing with a // shared region, since another cache may // have already destroyed it in shared memory, in which our listeners // still need to be called and java region object cleaned up. InternalCache cache = dm.getExistingCache(); // only get the region while holding the appropriate destroy lock. // this prevents us from getting a "stale" region if (getOperation().isDistributed()) { String rootName = GemFireCacheImpl.parsePath(path)[0]; this.lockRoot = (LocalRegion) cache.getRegion(rootName); if (this.lockRoot == null) return null; this.lockRoot.acquireDestroyLock(); } return (LocalRegion) cache.getRegion(path); }
@Override protected CacheOperationMessage createMessage() { DestroyRegionMessage mssg; if (this.event instanceof ClientRegionEventImpl) { mssg = new DestroyRegionWithContextMessage(); ((DestroyRegionWithContextMessage) mssg).context = ((ClientRegionEventImpl) this.event).getContext(); } else { mssg = new DestroyRegionMessage(); } mssg.notifyOfRegionDeparture = this.notifyOfRegionDeparture; DistributedRegion rgn = getRegion(); mssg.serialNum = rgn.getSerialNumber(); Assert.assertTrue(mssg.serialNum != DistributionAdvisor.ILLEGAL_SERIAL); mssg.subregionSerialNumbers = rgn.getDestroyedSubregionSerialNumbers(); RegionEventImpl rei = (RegionEventImpl) this.event; mssg.eventID = rei.getEventId(); return mssg; }
protected RegionEventImpl createRegionEvent(DistributedRegion rgn) { return new RegionEventImpl(rgn, getOperation(), this.callbackArg, true /* originRemote */, getSender()); }
@Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { super.fromData(in); this.context = DataSerializer.readObject(in); }
@Override protected InternalCacheEvent createEvent(DistributedRegion rgn) throws EntryNotFoundException { RegionEventImpl event = createRegionEvent(rgn); if (this.filterRouting != null) { event.setLocalFilterInfo( this.filterRouting.getFilterInfo((InternalDistributedMember) rgn.getMyId())); } event.setEventID(this.eventID); return event; }