mridulm commented on code in PR #43165:
URL: https://github.com/apache/spark/pull/43165#discussion_r1341990661
##########
common/network-common/src/main/java/org/apache/spark/network/util/NettyLogger.java:
##########
@@ -42,6 +45,14 @@ protected String format(ChannelHandlerContext ctx, String
eventName, Object arg)
} else if (arg instanceof ByteBufHolder) {
return format(ctx, eventName) + " " +
((ByteBufHolder) arg).content().readableBytes() + "B";
+ } else if (arg instanceof InputStream) {
+ int available = 0;
+ try {
+ available = ((InputStream) arg).available();
+ } catch (IOException ex) {
+ // Swallow
+ }
+ return format(ctx, eventName) + " " + available + "B";
Review Comment:
Specific input streams might have additional details that can be useful.
```suggestion
return format(ctx, eventName, arg) + " " + available + "B";
```
##########
common/network-common/src/main/java/org/apache/spark/network/util/NettyLogger.java:
##########
@@ -25,6 +25,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.IOException;
+import java.io.InputStream;
Review Comment:
java imports go first
--
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]