Package org.apache.flink.runtime.state
Class SavepointSnapshotStrategy<K>
java.lang.Object
org.apache.flink.runtime.state.SavepointSnapshotStrategy<K>
- All Implemented Interfaces:
SnapshotStrategy<KeyedStateHandle,FullSnapshotResources<K>>
public class SavepointSnapshotStrategy<K>
extends Object
implements SnapshotStrategy<KeyedStateHandle,FullSnapshotResources<K>>
A
SnapshotStrategy that produces unified savepoints.
See FullSnapshotRestoreOperation for an
explanation of the file layout of a savepoint.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.runtime.state.SnapshotStrategy
SnapshotStrategy.SnapshotResultSupplier<S extends StateObject> -
Constructor Summary
ConstructorsConstructorDescriptionSavepointSnapshotStrategy(FullSnapshotResources<K> savepointResources) Creates aSavepointSnapshotStrategythat writes a savepoint from the givenFullSnapshotResources. -
Method Summary
Modifier and TypeMethodDescriptionasyncSnapshot(FullSnapshotResources<K> savepointResources, long checkpointId, long timestamp, CheckpointStreamFactory streamFactory, CheckpointOptions checkpointOptions) Operation that writes a snapshot into a stream that is provided by the givenCheckpointStreamFactoryand returns a @SupplierWithExceptionthat gives a state handle to the snapshot.syncPrepareResources(long checkpointId) Performs the synchronous part of the snapshot.
-
Constructor Details
-
SavepointSnapshotStrategy
Creates aSavepointSnapshotStrategythat writes a savepoint from the givenFullSnapshotResources.
-
-
Method Details
-
syncPrepareResources
Description copied from interface:SnapshotStrategyPerforms the synchronous part of the snapshot. It returns resources which can be later on used in the asynchronous part.- Specified by:
syncPrepareResourcesin interfaceSnapshotStrategy<KeyedStateHandle,FullSnapshotResources<K>> - Parameters:
checkpointId- The ID of the checkpoint.- Returns:
- Resources needed to finish the snapshot.
- Throws:
Exception
-
asyncSnapshot
public SnapshotStrategy.SnapshotResultSupplier<KeyedStateHandle> asyncSnapshot(FullSnapshotResources<K> savepointResources, long checkpointId, long timestamp, @Nonnull CheckpointStreamFactory streamFactory, @Nonnull CheckpointOptions checkpointOptions) Description copied from interface:SnapshotStrategyOperation that writes a snapshot into a stream that is provided by the givenCheckpointStreamFactoryand returns a @SupplierWithExceptionthat gives a state handle to the snapshot.- Specified by:
asyncSnapshotin interfaceSnapshotStrategy<KeyedStateHandle,FullSnapshotResources<K>> checkpointId- The ID of the checkpoint.timestamp- The timestamp of the checkpoint.streamFactory- The factory that we can use for writing our state to streams.checkpointOptions- Options for how to perform this checkpoint.- Returns:
- A supplier that will yield a
StateObject.
-