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

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java
 ##########
 @@ -637,6 +636,11 @@ else if (current == ExecutionState.CANCELING) {
 
                        TaskKvStateRegistry kvStateRegistry = 
kvStateService.createKvStateTaskRegistry(jobId, getJobVertexId());
 
+                       InputGate[] gates = new InputGate[inputGates.length];
+                       for (int i = 0; i < inputGates.length; i++) {
 
 Review comment:
   To be honest, I liked wrapping in constructor more. This way we keep in 
`Task` and `RuntimeEnvironment` same objects and there is less risk for them to 
diverge and forget that we call real gate and not wrapper. What do you think?
   
   I would at least move the wrapping loop to a separate static method.

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