pnowojski commented on a change in pull request #8320: 
[FLINK-12201][network,metrics] Introduce InputGateWithMetrics in Task to 
increment numBytesIn metric
URL: https://github.com/apache/flink/pull/8320#discussion_r289282880
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/BufferOrEvent.java
 ##########
 @@ -43,26 +44,32 @@
 
        private int channelIndex;
 
-       BufferOrEvent(Buffer buffer, int channelIndex, boolean moreAvailable) {
+       private final int size;
+
+       public BufferOrEvent(Buffer buffer, int channelIndex, boolean 
moreAvailable, int size) {
 
 Review comment:
   why are we passing this new field explicitly? Why not
   ```
   this.size = buffer.getSize();
   ```
   ?
   
   Further more, why do we need `size` field at all? Why not implement:
   ```
   int getSize() {
     return buffer == null ? 0 : buffer.getSize();
   }
   ```

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


With regards,
Apache Git Services

Reply via email to