kirklund commented on a change in pull request #6104:
URL: https://github.com/apache/geode/pull/6104#discussion_r590675288
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/DistributedPutAllOperation.java
##########
@@ -814,6 +818,46 @@ protected FilterRoutingInfo getRecipientFilterRouting(Set
cacheOpRecipients) {
return consolidated;
}
+ @Override
+ protected void removeDestroyTokensFromCqResultKeys(FilterRoutingInfo
filterRouting) {
+ for (InternalDistributedMember m : filterRouting.getMembers()) {
+ FilterInfo filterInfo = filterRouting.getFilterInfo(m);
+ if (filterInfo.getCQs() == null) {
+ continue;
+ }
+
+ CacheDistributionAdvisor.CacheProfile cf =
+ (CacheDistributionAdvisor.CacheProfile) ((Bucket)
getRegion()).getPartitionedRegion()
+ .getCacheDistributionAdvisor().getProfile(m);
+
+ if (cf == null || cf.filterProfile == null ||
cf.filterProfile.isLocalProfile()
+ || cf.filterProfile.getCqMap().isEmpty()) {
+ continue;
+ }
+
+ for (Object value : cf.filterProfile.getCqMap().values()) {
+ ServerCQ cq = (ServerCQ) value;
+
+ for (Map.Entry<Long, Integer> e : filterInfo.getCQs().entrySet()) {
+ Long cqID = e.getKey();
+ // For the CQs satisfying the event with destroy CQEvent, remove
+ // the entry from CQ cache.
+ for (int i = 0; i < this.putAllData.length; i++) {
+ @Unretained
+ EntryEventImpl entryEvent = getEventForPosition(i);
+ if (entryEvent != null) {
+ if (cq != null && cq.getFilterID() != null &&
cq.getFilterID().equals(cqID)
+ && (e.getValue().equals(MessageType.LOCAL_DESTROY))
+ && entryEvent.getKey() != null) {
+ cq.removeFromCqResultKeys(entryEvent.getKey(), true);
+ }
+
+ }
+ }
+ }
+ }
Review comment:
In the future, you might want to try extracting some of those
inner-loops or inner-if-blocks to their own methods. How you name those methods
can then really improve understanding. It's also too easy to get lost in those
deeply nested structures like this.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]