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>>
ASnapshotStrategythat produces unified savepoints.See
FullSnapshotRestoreOperationfor an explanation of the file layout of a savepoint.- See Also:
FullSnapshotRestoreOperation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.state.SnapshotStrategy
SnapshotStrategy.SnapshotResultSupplier<S extends StateObject>
-
-
Constructor Summary
Constructors Constructor Description SavepointSnapshotStrategy(FullSnapshotResources<K> savepointResources)Creates aSavepointSnapshotStrategythat writes a savepoint from the givenFullSnapshotResources.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SnapshotStrategy.SnapshotResultSupplier<KeyedStateHandle>asyncSnapshot(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.FullSnapshotResources<K>syncPrepareResources(long checkpointId)Performs the synchronous part of the snapshot.
-
-
-
Constructor Detail
-
SavepointSnapshotStrategy
public SavepointSnapshotStrategy(FullSnapshotResources<K> savepointResources)
Creates aSavepointSnapshotStrategythat writes a savepoint from the givenFullSnapshotResources.
-
-
Method Detail
-
syncPrepareResources
public FullSnapshotResources<K> syncPrepareResources(long checkpointId) throws Exception
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.
-
-