@Override public void basicDestroy(final EntryEventImpl event, final boolean cacheWrite, Object expectedOldValue) throws EntryNotFoundException, CacheWriterException, TimeoutException { try { super.basicDestroy(event, cacheWrite, expectedOldValue); } finally { GatewaySenderEventImpl.release(event.getRawOldValue()); } }
@Override public void performRemoveAllEntry(EntryEventImpl event) { // force shared data view so that we just do the virtual op, accruing things in the bulk // operation for later if (isTX()) { event.getRemoveAllOperation().addEntry(event); } else { basicDestroy(event, true, null); } }
@Override protected void verifyDistributeDestroy(DistributedRegion region, EntryEventImpl event, int cnt) { region.basicDestroy(event, false, null); // verify the result if (cnt > 0) { verify(region, times(cnt)).distributeDestroy(eq(event), any()); } else { verify(region, never()).distributeDestroy(eq(event), any()); } }
@Override protected boolean operateOnRegion(CacheEvent event, ClusterDistributionManager dm) throws EntryNotFoundException { EntryEventImpl ev = (EntryEventImpl) event; DistributedRegion rgn = (DistributedRegion) ev.getRegion(); try { if (!rgn.isCacheContentProxy()) { rgn.basicDestroy(ev, false, null); // expectedOldValue not supported on // non- partitioned regions } this.appliedOperation = true; } catch (ConcurrentCacheModificationException e) { dispatchElidedEvent(rgn, ev); return true; // concurrent modifications are not reported to the sender } catch (EntryNotFoundException e) { dispatchElidedEvent(rgn, ev); if (!ev.isConcurrencyConflict()) { rgn.notifyGatewaySender(EnumListenerEvent.AFTER_DESTROY, ev); } throw e; } catch (CacheWriterException e) { throw new Error( "CacheWriter should not be called", e); } catch (TimeoutException e) { throw new Error("DistributedLock should not be acquired", e); } return true; }
@Override @SuppressWarnings("synthetic-access") public void run() { InternalDistributedMember myId = r.getDistributionManager().getDistributionManagerId(); for (int i = 0; i < removeAllDataCount; ++i) { @Released EntryEventImpl ev = RemoveAllPRMessage.getEventFromEntry(r, myId, eventSender, i, removeAllData, false, bridgeContext, posDup, false); try { ev.setRemoveAllOperation(op); if (logger.isDebugEnabled()) { logger.debug("invoking basicDestroy with {}", ev); } try { dr.basicDestroy(ev, true, null); } catch (EntryNotFoundException ignore) { } removeAllData[i].versionTag = ev.getVersionTag(); versions.addKeyAndVersion(removeAllData[i].getKey(), ev.getVersionTag()); } finally { ev.release(); } } } }, baseEvent.getEventId());
rgn.basicDestroy(ev, false, null); } catch (EntryNotFoundException ignore) { this.appliedOperation = true;