/** * Creates a new state backend that stores its checkpoint data in the file system and location * defined by the given URI. * * <p>A file system for the file system scheme in the URI (e.g., 'file://', 'hdfs://', or 'S3://') * must be accessible via {@link FileSystem#get(URI)}. * * <p>For a state backend targeting HDFS, this means that the URI must either specify the authority * (host and port), or that the Hadoop configuration that describes that information must be in the * classpath. * * @param checkpointDataUri The URI describing the filesystem (scheme and optionally authority), * and the path to the checkpoint data directory. * @param fileStateSizeThreshold State up to this size will be stored as part of the metadata, * rather than in files * @param asynchronousSnapshots Switch to enable asynchronous snapshots. * * @throws IOException Thrown, if no file system can be found for the scheme in the URI. */ public FsStateBackend( URI checkpointDataUri, int fileStateSizeThreshold, boolean asynchronousSnapshots) throws IOException { checkArgument(fileStateSizeThreshold >= 0, "The threshold for file state size must be zero or larger."); checkArgument(fileStateSizeThreshold <= MAX_FILE_STATE_THRESHOLD, "The threshold for file state size cannot be larger than %s", MAX_FILE_STATE_THRESHOLD); this.fileStateThreshold = fileStateSizeThreshold; this.basePath = validateAndNormalizeUri(checkpointDataUri); this.asynchronousSnapshots = asynchronousSnapshots; }