Package org.apache.flink.runtime.history
Class FsJobArchivist
java.lang.Object
org.apache.flink.runtime.history.FsJobArchivist
Utility class for writing an archive file to a
FileSystem and reading it back.-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.flink.core.fs.PatharchiveJob(org.apache.flink.core.fs.Path rootPath, org.apache.flink.api.common.JobID jobId, Collection<ArchivedJson> jsonToArchive) Writes the givenAccessExecutionGraphto theFileSystempointed to byJobManagerOptions.ARCHIVE_DIR.static Collection<ArchivedJson>getArchivedJsons(org.apache.flink.core.fs.Path file) Reads the given archive file and returns aCollectionof containedArchivedJson.
-
Method Details
-
archiveJob
public static org.apache.flink.core.fs.Path archiveJob(org.apache.flink.core.fs.Path rootPath, org.apache.flink.api.common.JobID jobId, Collection<ArchivedJson> jsonToArchive) throws IOException Writes the givenAccessExecutionGraphto theFileSystempointed to byJobManagerOptions.ARCHIVE_DIR.- Parameters:
rootPath- directory to which the archive should be written tojobId- job idjsonToArchive- collection of json-path pairs to that should be archived- Returns:
- path to where the archive was written, or null if no archive was created
- Throws:
IOException
-
getArchivedJsons
public static Collection<ArchivedJson> getArchivedJsons(org.apache.flink.core.fs.Path file) throws IOException Reads the given archive file and returns aCollectionof containedArchivedJson.- Parameters:
file- archive to extract- Returns:
- collection of archived jsons
- Throws:
IOException- if the file can't be opened, read or doesn't contain valid json
-