zhijiangW commented on a change in pull request #11507: [FLINK-16587] Add basic 
CheckpointBarrierHandler for unaligned checkpoint
URL: https://github.com/apache/flink/pull/11507#discussion_r399967382
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGate.java
 ##########
 @@ -170,9 +173,14 @@
 
        private final CompletableFuture<Void> closeFuture;
 
+       @Nullable
+       protected BufferReceivedListener bufferReceivedListener;
 
 Review comment:
   In general, I also hate the non-final fields in class. But in this case, it 
seems not easy to make it final, because the `SingleInputGate` is created by 
`ShuffleEnvironment` in task constructor, which belongs to shuffle service 
component. And `CheckpointedInputGate`, `UnionInputGate`, 
`CheckpointBarrierHandler` are constructed inside task invokable, which belongs 
to task component.  So we can not get the `CheckpointBarrierHandler` instance 
while constructing `SingleInputGate`.
   
   Another way to handle this case is via monitoring the future from serious 
upper to lower components, just like the existing way that `UnionInputGate` 
monitors data available from `SingleInputGate`. That means when the 
`SingleInputGate` receives barrier or buffer from network, it completes some 
future to make it aware by upper `UnionInputGate`, `CheckpointedInputGate`.  
But it seems more complex with existing data available future.
   
   So I agree with the option of volatile and guarantee it is set only once. 

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