pivotal-jbarrett commented on a change in pull request #7083:
URL: https://github.com/apache/geode/pull/7083#discussion_r759637788



##########
File path: 
geode-wan-txgrouping/src/main/java/org/apache/geode/cache/wan/internal/txgrouping/serial/TxGroupingSerialGatewaySenderQueue.java
##########
@@ -126,4 +148,110 @@ protected void postProcessBatch(final List<AsyncEvent<?, 
?>> batch, final long l
         lastKey);
   }
 
+  /**
+   * This method returns a list of objects that fulfill the matchingPredicate
+   * If a matching object also fulfills the endPredicate then the method
+   * stops looking for more matching objects.
+   */
+  protected List<KeyAndEventPair> 
getElementsMatching(Predicate<GatewaySenderEventImpl> condition,
+      Predicate<GatewaySenderEventImpl> stopCondition,
+      long lastKey) {
+    GatewaySenderEventImpl event;
+    List<KeyAndEventPair> elementsMatching = new ArrayList<>();
+
+    long currentKey = lastKey;
+
+    while ((currentKey = inc(currentKey)) != getTailKey()) {
+      if (extraPeekedIds.contains(currentKey)) {
+        continue;
+      }
+      event = (GatewaySenderEventImpl) optimalGet(currentKey);
+      if (event == null) {
+        continue;
+      }
+
+      if (condition.test(event)) {
+        elementsMatching.add(new KeyAndEventPair(currentKey, event));
+
+        if (stopCondition.test(event)) {
+          break;
+        }
+      }
+    }
+
+    return elementsMatching;
+  }
+
+  @Override
+  public synchronized void remove() throws CacheException {

Review comment:
       See https://github.com/Nordix/geode/pull/17




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to