leixm commented on code in PR #2702:
URL: https://github.com/apache/celeborn/pull/2702#discussion_r1730777028
##########
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:
This condition `!_deque.isEmpty() && currentTime -
_deque.getFirst().getLeft() >= timeWindowsInMills` and `_deque.size() >
maxQueueSize ` are equivalent because one element in _deque is one second.
--
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]