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


##########
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointRetentionPolicy.java:
##########
@@ -24,6 +24,9 @@
 @Internal
 public enum CheckpointRetentionPolicy {
 
+    /** Full Checkpoints should be retained on cancellation and failure. */
+    FULL_RETAIN_ON_CANCELLATION,

Review Comment:
   I could see use cases for manually triggering incremental checkpoints as 
well, so I would suggest to full/incremental parameter. We would need to 
decouple REST API constants from the internal classes and add a translation 
layer for that. It should be probably something similar to 
`org.apache.flink.core.execution.SavepointFormatType`. `CheckpointType` with 
two supported values `INCREMENTAL` and `FULL`. 
   
   As for the `CheckpointProperties` class, probably you should copy instead of 
passing `CheckpointProperties` in 
`org.apache.flink.runtime.checkpoint.CheckpointCoordinator#triggerCheckpoint(org.apache.flink.runtime.checkpoint.CheckpointProperties)`,
 you should just pass `org.apache.flink.runtime.checkpoint.CheckpointType` and 
inside the `triggerCheckpoint` construct new `CheckpointProperties` by copying 
`org.apache.flink.runtime.checkpoint.CheckpointCoordinator#checkpointProperties`.
 Something like that:
   ```
   
       public CompletableFuture<CompletedCheckpoint> 
triggerCheckpoint(CheckpointType checkpointType) {
           CheckpointProperties properties =
                   new CheckpointProperties(
                           checkpointProperties.forceCheckpoint(),
                           checkpointType,
                           checkpointProperties.discardOnSubsumed(),
                           checkpointProperties.discardOnJobFinished(),
                           checkpointProperties.discardOnJobCancelled(),
                           checkpointProperties.discardOnJobFailed(),
                           checkpointProperties.discardOnJobSuspended(),
                           checkpointProperties.isUnclaimed());
           return triggerCheckpointFromCheckpointThread(properties, null, 
false);
       }
   ```
   Rest API Handler would then translate the REST API `CheckpointType` into the 
internal `CheckpointType` (note there would be two `CheckpointType`. One enum 
in the REST API, the other, pre existing 
`org.apache.flink.runtime.checkpoint.CheckpointType` class).
   
   However it would be great if @zentol could validate if that's the way it 
should be done from the REST API perspective 😅 



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