code: public static CheckpointProperties forCheckpoint(CheckpointRetentionPolicy policy) {
  		switch (policy) {
  			case NEVER_RETAIN_AFTER_TERMINATION:
  				return CHECKPOINT_NEVER_RETAINED;
  			case RETAIN_ON_FAILURE:
  				return CHECKPOINT_RETAINED_ON_FAILURE;
  			case RETAIN_ON_CANCELLATION:
  				return CHECKPOINT_RETAINED_ON_CANCELLATION;
  			default:
  				throw new IllegalArgumentException("unknown policy: " + policy);
  		}
  	}
docs: Creates the checkpoint properties for a checkpoint.
  
  <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.
  
  @return Checkpoint properties for an external checkpoint.