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

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SubtaskCheckpointCoordinatorImpl.java
 ##########
 @@ -21,53 +21,79 @@
 import org.apache.flink.runtime.checkpoint.CheckpointMetaData;
 import org.apache.flink.runtime.checkpoint.CheckpointMetrics;
 import org.apache.flink.runtime.checkpoint.CheckpointOptions;
+import org.apache.flink.runtime.checkpoint.StateObjectCollection;
+import org.apache.flink.runtime.checkpoint.channel.ChannelStateWriter;
+import 
org.apache.flink.runtime.checkpoint.channel.ChannelStateWriter.ChannelStateWriteResult;
+import org.apache.flink.runtime.checkpoint.channel.ChannelStateWriterImpl;
 import org.apache.flink.runtime.execution.Environment;
 import org.apache.flink.runtime.jobgraph.OperatorID;
+import org.apache.flink.runtime.state.CheckpointStorageLocationReference;
 import org.apache.flink.runtime.state.CheckpointStorageWorkerView;
 import org.apache.flink.runtime.state.CheckpointStreamFactory;
+import org.apache.flink.runtime.state.SnapshotResult;
 import org.apache.flink.streaming.api.operators.OperatorSnapshotFutures;
 import org.apache.flink.streaming.api.operators.StreamOperator;
+import org.apache.flink.util.WrappingRuntimeException;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
 import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutorService;
 import java.util.function.Supplier;
 
+import static org.apache.flink.runtime.checkpoint.CheckpointType.CHECKPOINT;
 import static org.apache.flink.util.Preconditions.checkNotNull;
 
 class SubtaskCheckpointCoordinatorImpl implements SubtaskCheckpointCoordinator 
{
 
        private static final Logger LOG = 
LoggerFactory.getLogger(SubtaskCheckpointCoordinatorImpl.class);
 
-       private final CheckpointStorageWorkerView checkpointStorage;
+       private final CachingCheckpointStorageWorkerView checkpointStorage;
        private final String taskName;
        private final CloseableRegistry closeableRegistry;
        private final ExecutorService executorService;
        private final Environment env;
        private final AsyncExceptionHandler asyncExceptionHandler;
+       private final ChannelStateWriter channelStateWriter;
 
        SubtaskCheckpointCoordinatorImpl(
-               CheckpointStorageWorkerView checkpointStorage,
-               String taskName,
-               CloseableRegistry closeableRegistry,
-               ExecutorService executorService,
-               Environment env,
-               AsyncExceptionHandler asyncExceptionHandler) {
-               this.checkpointStorage = checkNotNull(checkpointStorage);
+                       CheckpointStorageWorkerView checkpointStorage,
+                       String taskName,
+                       CloseableRegistry closeableRegistry,
+                       ExecutorService executorService,
+                       Environment env,
+                       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.closeableRegistry.registerCloseable(this);
 
 Review comment:
   should register `this` after it is constructed completely? 

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