public class FsMergingCheckpointStorageLocation extends FsCheckpointStorageLocation
FsCheckpointStreamFactory.FsCheckpointStateOutputStream
MAX_FILE_STATE_THRESHOLD
Constructor and Description |
---|
FsMergingCheckpointStorageLocation(FileMergingSnapshotManager.SubtaskKey subtaskKey,
FileSystem fileSystem,
Path checkpointDir,
Path sharedStateDir,
Path taskOwnedStateDir,
CheckpointStorageLocationReference reference,
int fileStateSizeThreshold,
int writeBufferSize,
FileMergingSnapshotManager fileMergingSnapshotManager,
long checkpointId) |
Modifier and Type | Method and Description |
---|---|
boolean |
canFastDuplicate(StreamStateHandle stateHandle,
CheckpointedStateScope scope)
Tells if we can duplicate the given
StreamStateHandle into the path corresponding to
the given CheckpointedStateScope . |
boolean |
couldReuseStateHandle(StreamStateHandle stateHandle)
A pre-check hook before the checkpoint writer want to reuse a state handle, if this returns
false, it is not recommended for the writer to rewrite the state file considering the space
amplification.
|
FileMergingCheckpointStateOutputStream |
createCheckpointStateOutputStream(CheckpointedStateScope scope)
Creates an new
CheckpointStateOutputStream . |
List<StreamStateHandle> |
duplicate(List<StreamStateHandle> stateHandles,
CheckpointedStateScope scope)
Duplicates
StreamStateHandle into the path corresponding to * the given CheckpointedStateScope . |
DirectoryStreamStateHandle |
getExclusiveStateHandle() |
DirectoryStreamStateHandle |
getSharedStateHandle() |
void |
reusePreviousStateHandle(Collection<? extends StreamStateHandle> previousHandle)
A callback method when some previous handle is reused.
|
CheckpointStreamFactory |
toNonFileMerging() |
String |
toString() |
createMetadataOutputStream, disposeOnFailure, getCheckpointDirectory, getLocationReference, getMetadataFilePath, getSharedStateDirectory, getTaskOwnedStateDirectory
public FsMergingCheckpointStorageLocation(FileMergingSnapshotManager.SubtaskKey subtaskKey, FileSystem fileSystem, Path checkpointDir, Path sharedStateDir, Path taskOwnedStateDir, CheckpointStorageLocationReference reference, int fileStateSizeThreshold, int writeBufferSize, FileMergingSnapshotManager fileMergingSnapshotManager, long checkpointId)
public CheckpointStreamFactory toNonFileMerging()
public DirectoryStreamStateHandle getExclusiveStateHandle()
public DirectoryStreamStateHandle getSharedStateHandle()
public boolean canFastDuplicate(StreamStateHandle stateHandle, CheckpointedStateScope scope) throws IOException
CheckpointStreamFactory
StreamStateHandle
into the path corresponding to
the given CheckpointedStateScope
.
This should be a rather cheap operation, preferably not involving any remote accesses.
canFastDuplicate
in interface CheckpointStreamFactory
canFastDuplicate
in class FsCheckpointStreamFactory
stateHandle
- The handle to duplicatescope
- Scope determining the location to duplicate intoIOException
public List<StreamStateHandle> duplicate(List<StreamStateHandle> stateHandles, CheckpointedStateScope scope) throws IOException
CheckpointStreamFactory
StreamStateHandle
into the path corresponding to * the given CheckpointedStateScope
.
You should first check if you can duplicate with CheckpointStreamFactory.canFastDuplicate(StreamStateHandle, CheckpointedStateScope)
.
duplicate
in interface CheckpointStreamFactory
duplicate
in class FsCheckpointStreamFactory
stateHandles
- The handles to duplicatescope
- Scope determining the location to duplicate intoIOException
public FileMergingCheckpointStateOutputStream createCheckpointStateOutputStream(CheckpointedStateScope scope) throws IOException
CheckpointStreamFactory
CheckpointStateOutputStream
. When the stream is closed, it returns a
state handle that can retrieve the state back.createCheckpointStateOutputStream
in interface CheckpointStreamFactory
createCheckpointStateOutputStream
in class FsCheckpointStreamFactory
scope
- The state's scope, whether it is exclusive or shared.IOException
- Exceptions may occur while creating the stream and should be forwarded.public void reusePreviousStateHandle(Collection<? extends StreamStateHandle> previousHandle)
CheckpointStreamFactory
previousHandle
- the previous handles that will be reused.public boolean couldReuseStateHandle(StreamStateHandle stateHandle)
CheckpointStreamFactory
stateHandle
- the handle to be reused.public String toString()
toString
in class FsCheckpointStorageLocation
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.