stevenzwu commented on code in PR #20852:
URL: https://github.com/apache/flink/pull/20852#discussion_r979025202


##########
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java:
##########
@@ -511,6 +514,45 @@ public CompletableFuture<CompletedCheckpoint> 
triggerCheckpoint(boolean isPeriod
         return triggerCheckpointFromCheckpointThread(checkpointProperties, 
null, isPeriodic);
     }
 
+    /**
+     * Triggers one new checkpoint with the given checkpointBackupType. If the 
given
+     * checkpointBackupType is null, then it will fall back to use the 
CheckpointCoordinator's
+     * checkpointProperties. The return value is a future. It completes when 
the checkpoint
+     * triggered finishes or an error occurred.
+     *
+     * @param checkpointBackupType specifies the back up type of the 
checkpoint to trigger.
+     * @return a future to the completed checkpoint.
+     */
+    public CompletableFuture<CompletedCheckpoint> triggerCheckpoint(
+            @Nullable CheckpointBackupType checkpointBackupType) {
+
+        if (checkpointBackupType == null) {
+            return triggerCheckpointFromCheckpointThread(checkpointProperties, 
null, false);

Review Comment:
   might be a little cleaner to avoid calling `trigger...` here. we can just 
resolve the `checkpointType` and call the `trigger...` at line 543. Also if we 
directly use `CheckpointType` and removed the `CheckpointBackupType`, this can 
be even simpler. 



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to