pivotal-jbarrett commented on code in PR #7323:
URL: https://github.com/apache/geode/pull/7323#discussion_r850559223


##########
geode-core/src/main/java/org/apache/geode/internal/cache/AbstractBucketRegionQueue.java:
##########
@@ -223,6 +231,8 @@ protected void loadEventsFromTempQueue() {
       // .getBucketToTempQueueMap().get(getId());

Review Comment:
   Remove commented out code.



##########
geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySender.java:
##########
@@ -1298,6 +1301,26 @@ public boolean removeFromTempQueueEvents(Object tailKey) 
{
     }
   }
 
+  public boolean markAsDuplicateInTempQueueEvents(Object tailKey) {
+    synchronized (queuedEventsSync) {
+      Iterator<TmpQueueEvent> itr = tmpQueuedEvents.iterator();
+      while (itr.hasNext()) {

Review Comment:
   Yes, but I don't see where `itr` is used outside the loop where anything 
other than `next()` is invoked. You early exit the loop with returns. This can 
all be done in a for each loop.



##########
geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySender.java:
##########
@@ -1298,6 +1301,26 @@ public boolean removeFromTempQueueEvents(Object tailKey) 
{
     }
   }
 
+  public boolean markAsDuplicateInTempQueueEvents(Object tailKey) {
+    synchronized (queuedEventsSync) {
+      Iterator<TmpQueueEvent> itr = tmpQueuedEvents.iterator();
+      while (itr.hasNext()) {

Review Comment:
   Alternatively this could be completed with streams.



-- 
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: notifications-unsubscr...@geode.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to