Class CheckpointStorageLoader


  • @Internal
    public class CheckpointStorageLoader
    extends Object
    This class contains utility methods to load checkpoint storage from configurations.
    • Constructor Detail

      • CheckpointStorageLoader

        public CheckpointStorageLoader()
    • Method Detail

      • fromConfig

        public static Optional<CheckpointStorage> fromConfig​(org.apache.flink.configuration.ReadableConfig config,
                                                             ClassLoader classLoader,
                                                             @Nullable
                                                             org.slf4j.Logger logger)
                                                      throws IllegalStateException,
                                                             org.apache.flink.util.DynamicCodeLoadingException
        Loads the checkpoint storage from the configuration, from the parameter 'execution.checkpointing.storage', as defined in CheckpointingOptions.CHECKPOINT_STORAGE.

        The implementation can be specified either via their shortcut name, or via the class name of a CheckpointStorageFactory. If a CheckpointStorageFactory class name is specified, the factory is instantiated (via its zero-argument constructor) and its CheckpointStorageFactory.createFromConfig(ReadableConfig, ClassLoader) method is called.

        Recognized shortcut names are '"jobmanager"', and '"filesystem"'.

        Parameters:
        config - The configuration to load the checkpoint storage from
        classLoader - The class loader that should be used to load the checkpoint storage
        logger - Optionally, a logger to log actions to (may be null)
        Returns:
        The instantiated checkpoint storage.
        Throws:
        org.apache.flink.util.DynamicCodeLoadingException - Thrown if a checkpoint storage factory is configured and the factory class was not found or the factory could not be instantiated
        org.apache.flink.configuration.IllegalConfigurationException - May be thrown by the CheckpointStorageFactory when creating / configuring the checkpoint storage in the factory
        IllegalStateException
      • load

        public static CheckpointStorage load​(@Nullable
                                             CheckpointStorage fromApplication,
                                             StateBackend configuredStateBackend,
                                             org.apache.flink.configuration.Configuration jobConfig,
                                             org.apache.flink.configuration.Configuration clusterConfig,
                                             ClassLoader classLoader,
                                             @Nullable
                                             org.slf4j.Logger logger)
                                      throws org.apache.flink.configuration.IllegalConfigurationException,
                                             org.apache.flink.util.DynamicCodeLoadingException
        Loads the configured CheckpointStorage for the job based on the following precedent rules:

        1) If the jobs configured StateBackend implements CheckpointStorage it will always be used. This is to maintain backwards compatibility with older versions of Flink that intermixed these responsibilities.

        2) Use the CheckpointStorage instance configured via the StreamExecutionEnvironment.

        3) Use the CheckpointStorage instance configured via the clusters config.yaml.

        4) Load a default CheckpointStorage instance.

        Parameters:
        fromApplication - The checkpoint storage instance passed to the jobs StreamExecutionEnvironment. Or null if not was set.
        configuredStateBackend - The jobs configured state backend.
        jobConfig - The job level configuration to load the checkpoint storage from.
        clusterConfig - The cluster level configuration to load the checkpoint storage from.
        classLoader - The class loader that should be used to load the checkpoint storage.
        logger - Optionally, a logger to log actions to (may be null).
        Returns:
        The configured checkpoint storage instance.
        Throws:
        org.apache.flink.util.DynamicCodeLoadingException - Thrown if a checkpoint storage factory is configured and the factory class was not found or the factory could not be instantiated
        org.apache.flink.configuration.IllegalConfigurationException - May be thrown by the CheckpointStorageFactory when creating / configuring the checkpoint storage in the factory