You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/07/16 08:58:43 UTC

[GitHub] [flink] TsReaper commented on a change in pull request #12867: [FLINK-18558][streaming] Introduce collect iterator with at least once semantics and exactly once semantics without fault tolerance

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