flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java
/**
	 * Test method to trigger a checkpoint/savepoint.
	 *
	 * @param timestamp The timestamp for the checkpoint.
	 * @param options The checkpoint options.
	 * @return A future to the completed checkpoint
	 */
Test method to trigger a checkpoint/savepoint.
@param timestamp The timestamp for the checkpoint.
@param options The checkpoint options.
@return A future to the completed checkpoint
Test method to trigger a checkpoint / savepoint . @param timestamp The timestamp for the checkpoint . @param options The checkpoint options . @return A future to the completed checkpoint
@VisibleForTesting
	@Internal
	public CompletableFuture<CompletedCheckpoint> triggerCheckpoint(long timestamp, CheckpointOptions options) throws Exception {
		switch (options.getCheckpointType()) {
			case SAVEPOINT:
				return triggerSavepoint(timestamp, options.getTargetLocation());
			case CHECKPOINT:
				CheckpointTriggerResult triggerResult =
					triggerCheckpoint(timestamp, checkpointProperties, checkpointDirectory, false);
				if (triggerResult.isSuccess()) {
					return triggerResult.getPendingCheckpoint().getCompletionFuture();
				} else {
					Throwable cause = new Exception("Failed to trigger checkpoint: " + triggerResult.getFailureReason().message());
					return FutureUtils.completedExceptionally(cause);
				}
			default:
				throw new IllegalArgumentException("Unknown checkpoint type: " + options.getCheckpointType());
		}
	}
@ VisibleForTesting @ Internal public CompletableFuture < CompletedCheckpoint > triggerCheckpoint ( long timestamp , CheckpointOptions options ) throws Exception { switch ( options . getCheckpointType ( ) ) { case SAVEPOINT : return triggerSavepoint ( timestamp , options . getTargetLocation ( ) ) ; case CHECKPOINT : CheckpointTriggerResult triggerResult = triggerCheckpoint ( timestamp , checkpointProperties , checkpointDirectory , false ) ; if ( triggerResult . isSuccess ( ) ) { return triggerResult . getPendingCheckpoint ( ) . getCompletionFuture ( ) ; } else { Throwable cause = new Exception ( "Failed to trigger checkpoint: " + triggerResult . getFailureReason ( ) . message ( ) ) ; return FutureUtils . completedExceptionally ( cause ) ; } default : throw new IllegalArgumentException ( "Unknown checkpoint type: " + options . getCheckpointType ( ) ) ; } }
Test method to trigger a checkpoint/savepoint.
Test method to trigger a checkpoint / savepoint .