@Override protected InternalCacheEvent createEvent(DistributedRegion rgn) throws EntryNotFoundException { RegionEventImpl event = createRegionEvent(rgn); event.setEventID(this.eventID); if (this.filterRouting != null) { event.setLocalFilterInfo(this.filterRouting.getFilterInfo(rgn.getMyId())); } return event; }
@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; }
@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 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 protected void notifyClientsOfTombstoneGC(Map<VersionSource, Long> regionGCVersions, Set<Object> removedKeys, EventID eventID, FilterInfo routing) { if (CacheClientNotifier.getInstance() != null) { // Only route the event to clients interested in the partitioned region. // We do this by constructing a region-level event and then use it to // have the filter profile ferret out all of the clients that have interest // in this region FilterProfile fp = getFilterProfile(); // fix for bug #46309 - don't send null/empty key set to clients if ((removedKeys != null && !removedKeys.isEmpty()) // bug #51877 - NPE in clients && (routing != null || (fp != null && fp.hasInterest()))) { RegionEventImpl regionEvent = new RegionEventImpl(getPartitionedRegion(), Operation.REGION_DESTROY, null, true, getMyId()); FilterInfo clientRouting = routing; if (clientRouting == null) { clientRouting = fp.getLocalFilterRouting(regionEvent); } regionEvent.setLocalFilterInfo(clientRouting); ClientUpdateMessage clientMessage = ClientTombstoneMessage.gc(getPartitionedRegion(), removedKeys, eventID); CacheClientNotifier.notifyClients(regionEvent, clientMessage); } } }
/** * pass tombstone garbage-collection info to clients * * @param eventID the ID of the event (see bug #50683) * @param routing routing info (routing is computed if this is null) */ protected void notifyClientsOfTombstoneGC(Map<VersionSource, Long> regionGCVersions, Set<Object> keysRemoved, EventID eventID, FilterInfo routing) { if (CacheClientNotifier.getInstance() != null) { // Only route the event to clients interested in the partitioned region. // We do this by constructing a region-level event and then use it to // have the filter profile ferret out all of the clients that have interest // in this region FilterProfile fp = getFilterProfile(); if (fp != null || routing != null) { // null check - fix for bug #45614 RegionEventImpl regionEvent = new RegionEventImpl(this, Operation.REGION_DESTROY, null, true, getMyId()); regionEvent.setEventID(eventID); FilterInfo clientRouting = routing; if (clientRouting == null) { clientRouting = fp.getLocalFilterRouting(regionEvent); } regionEvent.setLocalFilterInfo(clientRouting); ClientUpdateMessage clientMessage = ClientTombstoneMessage.gc(this, regionGCVersions, eventID); CacheClientNotifier.notifyClients(regionEvent, clientMessage); } } }
getFilterProfile().getFilterRoutingInfoPart2(localCqFrInfo, event); if (localCqInterestFrInfo != null) { event.setLocalFilterInfo(localCqInterestFrInfo.getLocalFilterInfo());