Class MemCheckpointStreamFactory
- java.lang.Object
-
- org.apache.flink.runtime.state.memory.MemCheckpointStreamFactory
-
- All Implemented Interfaces:
CheckpointStreamFactory
- Direct Known Subclasses:
NonPersistentMetadataCheckpointStorageLocation,PersistentMetadataCheckpointStorageLocation
public class MemCheckpointStreamFactory extends Object implements CheckpointStreamFactory
CheckpointStreamFactorythat produces streams that write to in-memory byte arrays.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMemCheckpointStreamFactory.MemoryCheckpointOutputStreamACheckpointStateOutputStreamthat writes into a byte array.
-
Constructor Summary
Constructors Constructor Description MemCheckpointStreamFactory(int maxStateSize)Creates a new in-memory stream factory that accepts states whose serialized forms are up to the given number of bytes.
-
Method Summary
All Methods Instance Methods Concrete 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.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.flink.runtime.state.CheckpointStreamFactory
couldReuseStateHandle, reusePreviousStateHandle
-
-
-
-
Method Detail
-
createCheckpointStateOutputStream
public CheckpointStateOutputStream createCheckpointStateOutputStream(CheckpointedStateScope scope) throws IOException
Description copied from interface:CheckpointStreamFactoryCreates an newCheckpointStateOutputStream. When the stream is closed, it returns a state handle that can retrieve the state back.- Specified by:
createCheckpointStateOutputStreamin interfaceCheckpointStreamFactory- 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
public boolean canFastDuplicate(StreamStateHandle stateHandle, CheckpointedStateScope scope)
Description copied from interface:CheckpointStreamFactoryTells 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.
- Specified by:
canFastDuplicatein interfaceCheckpointStreamFactory- Parameters:
stateHandle- The handle to duplicatescope- Scope determining the location to duplicate into- Returns:
- true, if we can perform the duplication
-
duplicate
public List<StreamStateHandle> duplicate(List<StreamStateHandle> stateHandles, CheckpointedStateScope scope) throws IOException
Description copied from interface:CheckpointStreamFactoryDuplicatesStreamStateHandleinto the path corresponding to * the givenCheckpointedStateScope.You should first check if you can duplicate with
CheckpointStreamFactory.canFastDuplicate(StreamStateHandle, CheckpointedStateScope).- Specified by:
duplicatein interfaceCheckpointStreamFactory- Parameters:
stateHandles- The handles to duplicatescope- Scope determining the location to duplicate into- Returns:
- The duplicated handle
- Throws:
IOException
-
-