Package org.apache.flink.runtime.state
Interface CheckpointStreamWithResultProvider
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
CheckpointStreamWithResultProvider.PrimaryAndSecondaryStream,CheckpointStreamWithResultProvider.PrimaryStreamOnly
Interface that provides access to a CheckpointStateOutputStream and a method to provide the
SnapshotResult. This abstracts from different ways that a result is obtained from
checkpoint output streams.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceFactory method for aKeyedStateHandleto be used intoKeyedStateHandleSnapshotResult(SnapshotResult, KeyGroupRangeOffsets, KeyedStateHandleFactory).static classImplementation ofCheckpointStreamWithResultProviderthat creates both, the primary/remote/jm-owned state and the secondary/local/tm-owned state.static classImplementation ofCheckpointStreamWithResultProviderthat only creates the primary/remote/jm-owned state. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()Closes the stream ans returns a snapshot result with the stream handle(s).createDuplicatingStream(long checkpointId, CheckpointedStateScope checkpointedStateScope, CheckpointStreamFactory primaryStreamFactory, LocalSnapshotDirectoryProvider secondaryStreamDirProvider) createSimpleStream(CheckpointedStateScope checkpointedStateScope, CheckpointStreamFactory primaryStreamFactory) Returns the encapsulated output stream.static SnapshotResult<KeyedStateHandle>toKeyedStateHandleSnapshotResult(SnapshotResult<StreamStateHandle> snapshotResult, KeyGroupRangeOffsets keyGroupRangeOffsets, CheckpointStreamWithResultProvider.KeyedStateHandleFactory stateHandleFactory) Helper method that takes aSnapshotResult<StreamStateHandle>and aKeyGroupRangeOffsetsand creates aSnapshotResult<KeyedStateHandle>by combining the key groups offsets with all the present stream state handles.
-
Field Details
-
LOG
static final org.slf4j.Logger LOG
-
-
Method Details
-
closeAndFinalizeCheckpointStreamResult
@Nonnull SnapshotResult<StreamStateHandle> closeAndFinalizeCheckpointStreamResult() throws IOExceptionCloses the stream ans returns a snapshot result with the stream handle(s).- Throws:
IOException
-
getCheckpointOutputStream
Returns the encapsulated output stream. -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
createSimpleStream
@Nonnull static CheckpointStreamWithResultProvider createSimpleStream(@Nonnull CheckpointedStateScope checkpointedStateScope, @Nonnull CheckpointStreamFactory primaryStreamFactory) throws IOException - Throws:
IOException
-
createDuplicatingStream
@Nonnull static CheckpointStreamWithResultProvider createDuplicatingStream(@Nonnegative long checkpointId, @Nonnull CheckpointedStateScope checkpointedStateScope, @Nonnull CheckpointStreamFactory primaryStreamFactory, @Nonnull LocalSnapshotDirectoryProvider secondaryStreamDirProvider) throws IOException - Throws:
IOException
-
toKeyedStateHandleSnapshotResult
@Nonnull static SnapshotResult<KeyedStateHandle> toKeyedStateHandleSnapshotResult(@Nonnull SnapshotResult<StreamStateHandle> snapshotResult, @Nonnull KeyGroupRangeOffsets keyGroupRangeOffsets, @Nonnull CheckpointStreamWithResultProvider.KeyedStateHandleFactory stateHandleFactory) Helper method that takes aSnapshotResult<StreamStateHandle>and aKeyGroupRangeOffsetsand creates aSnapshotResult<KeyedStateHandle>by combining the key groups offsets with all the present stream state handles.
-