@Override public void postPutAllFireEvents(DistributedPutAllOperation putAllOp, VersionedObjectList successfulPuts) { if (!this.getDataPolicy().withStorage() && this.getConcurrencyChecksEnabled() && putAllOp.getBaseEvent().isBridgeEvent()) { // if there is no local storage we need to transfer version information // to the successfulPuts list for transmission back to the client successfulPuts.clear(); putAllOp.fillVersionedObjectList(successfulPuts); } Set successfulKeys = new HashSet(successfulPuts.size()); for (Object key : successfulPuts.getKeys()) { successfulKeys.add(key); } for (Iterator it = putAllOp.eventIterator(); it.hasNext();) { @Unretained EntryEventImpl event = (EntryEventImpl) it.next(); if (successfulKeys.contains(event.getKey())) { EnumListenerEvent op = event.getOperation().isCreate() ? EnumListenerEvent.AFTER_CREATE : EnumListenerEvent.AFTER_UPDATE; invokePutCallbacks(op, event, !event.callbacksInvoked() && !event.isPossibleDuplicate(), this.isUsedForPartitionedRegionBucket /* * If this is replicated region, use "false". We must notify gateways inside RegionEntry * lock, NOT here, to preserve the order of events sent by gateways for same key. If this is * bucket region, use "true", because the event order is guaranteed */); } } }
@Override public void postPutAll(DistributedPutAllOperation putallOp, VersionedObjectList successfulPuts, InternalRegion reg) { if (!reg.getDataPolicy().withStorage() && reg.getConcurrencyChecksEnabled() && putallOp.getBaseEvent().isBridgeEvent()) { // if there is no local storage we need to transfer version information // to the successfulPuts list for transmission back to the client successfulPuts.clear(); putallOp.fillVersionedObjectList(successfulPuts); } // BR & DR's putAll long token = -1; try { token = reg.postPutAllSend(putallOp, successfulPuts); reg.postPutAllFireEvents(putallOp, successfulPuts); } finally { if (token != -1 && reg instanceof DistributedRegion) { putallOp.endOperation(token); } } }