Package org.apache.flink.runtime.state
Interface CheckpointStreamFactory
-
- All Known Subinterfaces:
CheckpointStorageLocation
- All Known Implementing Classes:
FsCheckpointStorageLocation,FsCheckpointStreamFactory,FsMergingCheckpointStorageLocation,MemCheckpointStreamFactory,NonPersistentMetadataCheckpointStorageLocation,PersistentMetadataCheckpointStorageLocation
public interface CheckpointStreamFactoryA factory for checkpoint output streams, which are used to persist data for checkpoints.Stream factories can be created from the
CheckpointStorageAccessthroughCheckpointStorageWorkerView.resolveCheckpointStorageLocation(long, CheckpointStorageLocationReference).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanFastDuplicate(StreamStateHandle stateHandle, CheckpointedStateScope scope)Tells if we can duplicate the givenStreamStateHandleinto the path corresponding to the givenCheckpointedStateScope.CheckpointStateOutputStreamcreateCheckpointStateOutputStream(CheckpointedStateScope scope)Creates an newCheckpointStateOutputStream.List<StreamStateHandle>duplicate(List<StreamStateHandle> stateHandles, CheckpointedStateScope scope)DuplicatesStreamStateHandleinto the path corresponding to * the givenCheckpointedStateScope.
-
-
-
Method Detail
-
createCheckpointStateOutputStream
CheckpointStateOutputStream createCheckpointStateOutputStream(CheckpointedStateScope scope) throws IOException
Creates an newCheckpointStateOutputStream. When the stream is closed, it returns a state handle that can retrieve the state back.- Parameters:
scope- The state's scope, whether it is exclusive or shared.- Returns:
- An output stream that writes state for the given checkpoint.
- Throws:
IOException- Exceptions may occur while creating the stream and should be forwarded.
-
canFastDuplicate
boolean canFastDuplicate(StreamStateHandle stateHandle, CheckpointedStateScope scope) throws IOException
Tells if we can duplicate the givenStreamStateHandleinto the path corresponding to the givenCheckpointedStateScope.This should be a rather cheap operation, preferably not involving any remote accesses.
- Parameters:
stateHandle- The handle to duplicatescope- Scope determining the location to duplicate into- Returns:
- true, if we can perform the duplication
- Throws:
IOException
-
duplicate
List<StreamStateHandle> duplicate(List<StreamStateHandle> stateHandles, CheckpointedStateScope scope) throws IOException
DuplicatesStreamStateHandleinto the path corresponding to * the givenCheckpointedStateScope.You should first check if you can duplicate with
canFastDuplicate(StreamStateHandle, CheckpointedStateScope).- Parameters:
stateHandles- The handles to duplicatescope- Scope determining the location to duplicate into- Returns:
- The duplicated handle
- Throws:
IOException
-
-