public class SavepointStore extends Object
Stored savepoints have the following format:
MagicNumber SavepointVersion Savepoint - MagicNumber => int - SavepointVersion => int (returned by Savepoint#getVersion()) - Savepoint => bytes (serialized via version-specific SavepointSerializer)
Modifier and Type | Field and Description |
---|---|
static int |
MAGIC_NUMBER
Magic number for sanity checks against stored savepoints.
|
Constructor and Description |
---|
SavepointStore() |
Modifier and Type | Method and Description |
---|---|
static String |
createSavepointDirectory(String baseDirectory,
JobID jobId)
Creates a savepoint directory.
|
static void |
deleteSavepointDirectory(String savepointDirectory)
Deletes a savepoint directory.
|
static Savepoint |
loadSavepoint(String savepointFileOrDirectory,
ClassLoader classLoader)
Loads the savepoint at the specified path.
|
static Tuple2<Savepoint,StreamStateHandle> |
loadSavepointWithHandle(String savepointFileOrDirectory,
ClassLoader classLoader)
Loads the savepoint at the specified path.
|
static void |
removeSavepointFile(String path)
Removes the savepoint meta data w/o loading and disposing it.
|
static <T extends Savepoint> |
storeExternalizedCheckpointToHandle(String directory,
T savepoint)
Stores the externalized checkpoint metadata file to a state handle.
|
static <T extends Savepoint> |
storeSavepoint(String directory,
T savepoint)
Stores the savepoint metadata file.
|
static <T extends Savepoint> |
storeSavepointToHandle(String directory,
T savepoint)
Stores the savepoint metadata file to a state handle.
|
public static final int MAGIC_NUMBER
public static String createSavepointDirectory(@Nonnull String baseDirectory, @Nullable JobID jobId) throws IOException
baseDirectory
- Base target directory for the savepointjobId
- Optional JobID the savepoint belongs toIOException
- FileSystem operation failures are forwardedpublic static void deleteSavepointDirectory(@Nonnull String savepointDirectory) throws IOException
savepointDirectory
- Recursively deletes the given directoryIOException
- FileSystem operation failures are forwardedpublic static <T extends Savepoint> String storeSavepoint(String directory, T savepoint) throws IOException
T
- Savepoint typedirectory
- Target directory to store savepoint insavepoint
- Savepoint to be storedIOException
- Failures during store are forwardedpublic static <T extends Savepoint> FileStateHandle storeSavepointToHandle(String directory, T savepoint) throws IOException
directory
- Target directory to store savepoint insavepoint
- Savepoint to be storedIOException
- Failures during store are forwardedpublic static <T extends Savepoint> FileStateHandle storeExternalizedCheckpointToHandle(String directory, T savepoint) throws IOException
directory
- Target directory to store savepoint insavepoint
- Savepoint to be storedIOException
- Failures during store are forwardedpublic static Savepoint loadSavepoint(String savepointFileOrDirectory, ClassLoader classLoader) throws IOException
savepointFileOrDirectory
- Path to the parent savepoint directory or the meta data file.classLoader
- The class loader used to resolve serialized classes from legacy savepoint formats.IOException
- Failures during load are forwardedpublic static Tuple2<Savepoint,StreamStateHandle> loadSavepointWithHandle(String savepointFileOrDirectory, ClassLoader classLoader) throws IOException
savepointFileOrDirectory
- Path to the parent savepoint directory or the meta data file.classLoader
- The class loader used to resolve serialized classes from legacy savepoint formats.IOException
- Failures during load are forwardedpublic static void removeSavepointFile(String path) throws IOException
path
- Path of savepoint to removeIOException
- Failures during disposal are forwardedCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.