Retain Flink Checkpoint on cancellation

257 Views Asked by At

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?

1

There are 1 best solutions below

0
On

The same. You can setCheckpointStorage() directly in your application, or Flink will use the CheckpointingOptions.CHECKPOINTS_DIRECTORY to create a checkpoint storage.