I'm using Flink 1.15.0 and I want to keep triggered checkpoint when job is cancelled.
Flink indicates to set ExternalizeCheckpointCleanup mode in this way
env.getCheckpointConfig().setExternalizedCheckpointCleanup(
CheckpointConfig.ExternalizedCheckpointCleanup.RETAIN_ON_CANCELLATION);
From Javadoc they say:
The target directory for externalized checkpoints is configured via CheckpointingOptions.CHECKPOINTS_DIRECTORY.
So I wrote this line:
config.set(CheckpointingOptions.CHECKPOINTS_DIRECTORY, "hdfs:///checkpoints-data");
But in their documentation, they show this snippet:
env.getCheckpointConfig().setCheckpointStorage("hdfs:///checkpoints-data/");
What is the difference between checkpoint directory and checkpoint storage?
The same. You can
setCheckpointStorage()
directly in your application, or Flink will use theCheckpointingOptions.CHECKPOINTS_DIRECTORY
to create a checkpoint storage.