AngersZhuuuu commented on code in PR #2583:
URL: https://github.com/apache/celeborn/pull/2583#discussion_r1650268988
##########
worker/src/main/java/org/apache/celeborn/service/deploy/worker/storage/PartitionDataWriter.java:
##########
@@ -288,10 +295,10 @@ public void write(ByteBuf data) throws IOException {
MemoryManager.instance().increaseMemoryFileStorage(numBytes);
} else {
MemoryManager.instance().incrementDiskBuffer(numBytes);
- Optional.ofNullable(CongestionController.instance())
- .ifPresent(
- congestionController ->
-
congestionController.produceBytes(diskFileInfo.getUserIdentifier(), numBytes));
+ if (userBufferInfo != null) {
+ userBufferInfo.updateInfo(
+ System.currentTimeMillis(), new
BufferStatusHub.BufferStatusNode(numBytes));
+ }
Review Comment:
We can remove `congestionController.produceBytes()`
##########
worker/src/main/java/org/apache/celeborn/service/deploy/worker/congestcontrol/CongestionController.java:
##########
@@ -275,4 +252,19 @@ public static synchronized void destroy() {
_INSTANCE = null;
}
}
+
+ public UserBufferInfo getUserBuffer(UserIdentifier userIdentifier) {
+ return userBufferStatuses.computeIfAbsent(
+ userIdentifier,
+ user -> {
+ logger.info("New user {} comes, initializing its rate status", user);
+ BufferStatusHub bufferStatusHub = new
BufferStatusHub(sampleTimeWindowSeconds);
+ UserBufferInfo userInfo = new
UserBufferInfo(System.currentTimeMillis(), bufferStatusHub);
+ workerSource.addGauge(
+ WorkerSource.USER_PRODUCE_SPEED(),
+ userIdentifier.toJMap(),
+ () -> getUserProduceSpeed(userInfo));
+ return userInfo;
+ });
+ }
Review Comment:
Pls not put this method at the tail of this class code
--
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]