curcur commented on a change in pull request #13581:
URL: https://github.com/apache/flink/pull/13581#discussion_r547722393



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionAttemptID.java
##########
@@ -31,6 +31,7 @@
 public class ExecutionAttemptID implements java.io.Serializable {
 
        private static final long serialVersionUID = -1169683445778281344L;
+       private static final int BYTEBUF_LEN = 16;

Review comment:
       Would you please add a comment here, something like 
   "the length of two long types representing an `executionAttemptId`, with the 
lower part and the upper part taking one long type of length each" or something 
similar to explain where `16` comes from.

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyMessage.java
##########
@@ -259,7 +259,7 @@ protected Object decode(ChannelHandlerContext ctx, ByteBuf 
in) throws Exception
                static final byte ID = 0;
 
                // receiver ID (16), sequence number (4), backlog (4), dataType 
(1), isCompressed (1), buffer size (4)
-               static final int MESSAGE_HEADER_LENGTH = 16 + 4 + 4 + 1 + 1 + 4;
+               static final int MESSAGE_HEADER_LENGTH = 
InputChannelID.getByteBufLength() + Integer.BYTES + Integer.BYTES + Byte.BYTES 
+ 1 + Integer.BYTES;

Review comment:
       why `isCompressed` (boolean) is hardcoded, while everything else is not?

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/IntermediateResultPartitionID.java
##########
@@ -30,6 +30,7 @@
 public class IntermediateResultPartitionID implements ResultID {
 
        private static final long serialVersionUID = 1L;
+       private static final int BYTEBUF_LEN = 20;

Review comment:
       similarly here, please add a comment. 
   Where are the extra 4 bytes coming from? partitionNum?

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputChannelID.java
##########
@@ -28,6 +28,7 @@
 public class InputChannelID extends AbstractID {
 
        private static final long serialVersionUID = 1L;
+       private static final int BYTEBUF_LEN = 16;

Review comment:
       similarly here, please add a comment to explain.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to