KKcorps commented on code in PR #10251:
URL: https://github.com/apache/pinot/pull/10251#discussion_r1100990597


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java:
##########
@@ -305,10 +382,48 @@ protected void handleOutOfOrderEvent(Object 
currentComparisonValue, Object recor
     }
   }
 
+  protected void startOperation() {
+    _numPendingOperations.getAndIncrement();
+  }
+
+  protected void finishOperation() {
+    if (_numPendingOperations.decrementAndGet() == 0) {
+      synchronized (_numPendingOperations) {
+        _numPendingOperations.notifyAll();
+      }
+    }
+  }
+
+  @Override
+  public void stop() {
+    _stopped = true;
+    int numPendingOperations = _numPendingOperations.decrementAndGet();

Review Comment:
   Ohh is it because the AtomicInteger is initialized as 1 and not 0.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to