RexXiong commented on code in PR #2702:
URL: https://github.com/apache/celeborn/pull/2702#discussion_r1730773439


##########
worker/src/main/java/org/apache/celeborn/service/deploy/worker/congestcontrol/TimeSlidingHub.java:
##########
@@ -108,12 +121,7 @@ public synchronized void add(long currentTimestamp, N 
newNode) {
       nodeToCombine.combineNode(newNode);
       sumInfo = Pair.of(nodeToCombine, sumInfo.getRight() + nodesToAdd);
 
-      while (_deque.size() > maxQueueSize) {
-        Pair<Long, N> removed = _deque.removeFirst();
-        N nodeToSeparate = sumInfo.getLeft();
-        nodeToSeparate.separateNode(removed.getRight());
-        sumInfo = Pair.of(nodeToSeparate, sumInfo.getRight() - 1);
-      }
+      removeExpiredNodes();

Review Comment:
   Also need delete the element when _deque.size() > maxQueueSize?



##########
worker/src/main/java/org/apache/celeborn/service/deploy/worker/congestcontrol/TimeSlidingHub.java:
##########
@@ -108,12 +121,7 @@ public synchronized void add(long currentTimestamp, N 
newNode) {
       nodeToCombine.combineNode(newNode);
       sumInfo = Pair.of(nodeToCombine, sumInfo.getRight() + nodesToAdd);
 
-      while (_deque.size() > maxQueueSize) {
-        Pair<Long, N> removed = _deque.removeFirst();
-        N nodeToSeparate = sumInfo.getLeft();
-        nodeToSeparate.separateNode(removed.getRight());
-        sumInfo = Pair.of(nodeToSeparate, sumInfo.getRight() - 1);
-      }
+      removeExpiredNodes();

Review Comment:
   Also need delete the element when `_deque.size() > maxQueueSize?`



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