Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5248#discussion_r160752496
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointProperties.java
 ---
    @@ -251,77 +225,66 @@ public String toString() {
                        false,
                        false);
     
    -   private static final CheckpointProperties STANDARD_CHECKPOINT = new 
CheckpointProperties(
    -                   false,
    +   private static final CheckpointProperties CHECKPOINT_NEVER_RETAINED = 
new CheckpointProperties(
                        false,
                        false,
                        true,
    -                   true,
    -                   true,
    -                   true,
    -                   true);
    +                   true,  // Delete on success
    +                   true,  // Delete on cancellation
    +                   true,  // Delete on failure
    +                   true); // Delete on suspension
     
    -   private static final CheckpointProperties 
EXTERNALIZED_CHECKPOINT_RETAINED = new CheckpointProperties(
    +   private static final CheckpointProperties 
CHECKPOINT_RETAINED_ON_FAILURE = new CheckpointProperties(
                        false,
    -                   true,
                        false,
                        true,
    -                   true,
    -                   false, // Retain on cancellation
    -                   false,
    -                   false); // Retain on suspension
    +                   true,  // Delete on success
    +                   true,  // Delete on cancellation
    +                   false, // Retain on failure
    +                   true); // Delete on suspension
     
    -   private static final CheckpointProperties 
EXTERNALIZED_CHECKPOINT_DELETED = new CheckpointProperties(
    +   private static final CheckpointProperties 
CHECKPOINT_RETAINED_ON_CANCELLATION = new CheckpointProperties(
                        false,
    -                   true,
                        false,
                        true,
    -                   true,
    -                   true, // Delete on cancellation
    -                   false,
    -                   true); // Delete on suspension
    +                   true,   // Delete on success
    +                   false,  // Retain on cancellation
    +                   false,  // Retain on failure
    +                   false); // Retain on suspension
    +
     
        /**
         * Creates the checkpoint properties for a (manually triggered) 
savepoint.
         *
    -    * <p>Savepoints are forced and persisted externally. They have to be
    +    * <p>Savepoints are not queued due to time trigger limits. They have 
to be
         * garbage collected manually.
         *
         * @return Checkpoint properties for a (manually triggered) savepoint.
         */
    -   public static CheckpointProperties forStandardSavepoint() {
    -           return STANDARD_SAVEPOINT;
    -   }
    -
    -   /**
    -    * Creates the checkpoint properties for a regular checkpoint.
    -    *
    -    * <p>Regular checkpoints are not forced and not persisted externally. 
They
    -    * are garbage collected automatically.
    -    *
    -    * @return Checkpoint properties for a regular checkpoint.
    -    */
    -   public static CheckpointProperties forStandardCheckpoint() {
    -           return STANDARD_CHECKPOINT;
    +   public static CheckpointProperties forSavepoint() {
    +           return SAVEPOINT;
        }
     
        /**
    -    * Creates the checkpoint properties for an external checkpoint.
    +    * Creates the checkpoint properties for a checkpoint.
         *
    -    * <p>External checkpoints are not forced, but persisted externally. 
They
    -    * are garbage collected automatically, except when the owning job
    +    * <p>Checkpoints may be queued in case too many other checkpoints are 
currently happening.
    +    * They are garbage collected automatically, except when the owning job
         * terminates in state {@link JobStatus#FAILED}. The user is required to
         * configure the clean up behaviour on job cancellation.
         *
    -    * @param deleteOnCancellation Flag indicating whether to discard on 
cancellation.
    -    *
         * @return Checkpoint properties for an external checkpoint.
         */
    -   public static CheckpointProperties forExternalizedCheckpoint(boolean 
deleteOnCancellation) {
    -           if (deleteOnCancellation) {
    -                   return EXTERNALIZED_CHECKPOINT_DELETED;
    -           } else {
    -                   return EXTERNALIZED_CHECKPOINT_RETAINED;
    +   public static CheckpointProperties 
forCheckpoint(CheckpointRetentionPolicy policy) {
    --- End diff --
    
    There is actually a `forSavepoint(...)` method, that's why I think keeping 
the name makes sense. We could change it to `forCheckpointWithPolicy(...)` but 
I do not see a lot of value in that. Short names are also nice ;-)


---

Reply via email to