AHeise commented on a change in pull request #11515: [FLINK-16744][task] 
implement channel state persistence for unaligned checkpoints
URL: https://github.com/apache/flink/pull/11515#discussion_r405015903
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SubtaskCheckpointCoordinatorImpl.java
 ##########
 @@ -55,20 +68,33 @@
                        CloseableRegistry closeableRegistry,
                        ExecutorService executorService,
                        Environment env,
-                       AsyncExceptionHandler asyncExceptionHandler) {
-               this.checkpointStorage = checkNotNull(checkpointStorage);
+                       AsyncExceptionHandler asyncExceptionHandler,
+                       boolean sendChannelState) throws IOException {
+               this.checkpointStorage = new 
CachingCheckpointStorageWorkerView(checkNotNull(checkpointStorage));
                this.taskName = checkNotNull(taskName);
                this.closeableRegistry = checkNotNull(closeableRegistry);
                this.executorService = checkNotNull(executorService);
                this.env = checkNotNull(env);
                this.asyncExceptionHandler = 
checkNotNull(asyncExceptionHandler);
                this.actionExecutor = actionExecutor;
+               this.channelStateWriter = sendChannelState ? 
openChannelStateWriter() : ChannelStateWriter.NO_OP;
+               this.closeableRegistry.registerCloseable(this);
+       }
+
+       private ChannelStateWriterImpl openChannelStateWriter() {
+               ChannelStateWriterImpl writer = new 
ChannelStateWriterImpl(this.checkpointStorage);
+               writer.open();
 
 Review comment:
   This looks a bit suspicious. Do we actually need a dedicated `open` or could 
we `open` it in the constructor already. Maybe it would allow us to have more 
final fields?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to