SteNicholas commented on code in PR #2820:
URL: https://github.com/apache/celeborn/pull/2820#discussion_r1816665945


##########
worker/src/main/java/org/apache/celeborn/service/deploy/worker/storage/MapPartitionDataReader.java:
##########
@@ -255,11 +241,44 @@ public synchronized void sendData() {
     }
   }
 
-  private long getIndexRegionSize() {
+  public RequestMessage generateReadDataMessage(
+      long streamId, int subPartitionId, ByteBuf byteBuf) {
+    return new ReadData(streamId, byteBuf);
+  }
+
+  protected void sendDataInternal(RecyclableBuffer buffer) {
+    final RecyclableBuffer wrappedBuffer = buffer;
+    int readableBytes = wrappedBuffer.byteBuf.readableBytes();
+    if (logger.isDebugEnabled()) {
+      logger.debug("send data start: {}, {}", streamId, readableBytes);
+    }
+
+    RequestMessage readData =
+        generateReadDataMessage(streamId, wrappedBuffer.subPartitionId, 
wrappedBuffer.byteBuf);
+    associatedChannel
+        .writeAndFlush(readData)
+        .addListener(
+            (ChannelFutureListener)
+                future -> {
+                  try {
+                    if (!future.isSuccess()) {
+                      recycleOnError(future.cause());
+                    }
+                  } finally {
+                    logger.debug("send data end: {}, {}", streamId, 
readableBytes);

Review Comment:
   Does this need to check whether debug is enabled.



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