Package org.apache.flink.runtime.state
Interface CheckpointStreamWithResultProvider
-
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
CheckpointStreamWithResultProvider.PrimaryAndSecondaryStream
,CheckpointStreamWithResultProvider.PrimaryStreamOnly
public interface CheckpointStreamWithResultProvider extends Closeable
Interface that provides access to a CheckpointStateOutputStream and a method to provide theSnapshotResult
. This abstracts from different ways that a result is obtained from checkpoint output streams.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
CheckpointStreamWithResultProvider.KeyedStateHandleFactory
Factory method for aKeyedStateHandle
to be used intoKeyedStateHandleSnapshotResult(SnapshotResult, KeyGroupRangeOffsets, KeyedStateHandleFactory)
.static class
CheckpointStreamWithResultProvider.PrimaryAndSecondaryStream
Implementation ofCheckpointStreamWithResultProvider
that creates both, the primary/remote/jm-owned state and the secondary/local/tm-owned state.static class
CheckpointStreamWithResultProvider.PrimaryStreamOnly
Implementation ofCheckpointStreamWithResultProvider
that only creates the primary/remote/jm-owned state.
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.Logger
LOG
-
Method Summary
-
-
-
Method Detail
-
closeAndFinalizeCheckpointStreamResult
@Nonnull SnapshotResult<StreamStateHandle> closeAndFinalizeCheckpointStreamResult() throws IOException
Closes the stream ans returns a snapshot result with the stream handle(s).- Throws:
IOException
-
getCheckpointOutputStream
@Nonnull CheckpointStateOutputStream getCheckpointOutputStream()
Returns the encapsulated output stream.
-
close
default void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in 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
and aKeyGroupRangeOffsets
and creates aSnapshotResult
by combining the key groups offsets with all the present stream state handles.
-
-