TsReaper commented on a change in pull request #12867:
URL: https://github.com/apache/flink/pull/12867#discussion_r455633324



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/collect/CollectResultIterator.java
##########
@@ -40,18 +43,37 @@
        public CollectResultIterator(
                        CompletableFuture<OperatorID> operatorIdFuture,
                        TypeSerializer<T> serializer,
-                       String accumulatorName) {
-               this.fetcher = new CollectResultFetcher<>(operatorIdFuture, 
serializer, accumulatorName);
+                       String accumulatorName,
+                       CheckpointConfig checkpointConfig) {
+               if (checkpointConfig.getCheckpointingMode() == 
CheckpointingMode.EXACTLY_ONCE) {
+                       if (checkpointConfig.getCheckpointInterval() >= 
CheckpointCoordinatorConfiguration.MINIMAL_CHECKPOINT_TIME) {
+                               this.fetcher = new CollectResultFetcher<>(
+                                       new 
CheckpointedCollectResultBuffer<>(serializer),
+                                       operatorIdFuture,
+                                       accumulatorName);
+                       } else {
+                               this.fetcher = new CollectResultFetcher<>(
+                                       new 
UncheckpointedCollectResultBuffer<>(serializer, false),
+                                       operatorIdFuture,
+                                       accumulatorName);
+                       }

Review comment:
       If `checkpointConfig.getCheckpointInterval() >= 
CheckpointCoordinatorConfiguration.MINIMAL_CHECKPOINT_TIME` we are sure that 
the user explicitly enables a checkpoint. Otherwise we have to sync with the 
default value of checkpoint interval in `CheckpointCoordinatorConfiguration`.




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


Reply via email to