public class SavepointSnapshotStrategy<K> extends Object implements SnapshotStrategy<KeyedStateHandle,FullSnapshotResources<K>>
SnapshotStrategy
that produces unified savepoints.
See FullSnapshotRestoreOperation
for an
explanation of the file layout of a savepoint.
FullSnapshotRestoreOperation
SnapshotStrategy.SnapshotResultSupplier<S extends StateObject>
Constructor and Description |
---|
SavepointSnapshotStrategy(FullSnapshotResources<K> savepointResources)
Creates a
SavepointSnapshotStrategy that writes a savepoint from the given FullSnapshotResources . |
Modifier and Type | Method and 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 given
CheckpointStreamFactory and returns a @SupplierWithException that gives a state
handle to the snapshot. |
FullSnapshotResources<K> |
syncPrepareResources(long checkpointId)
Performs the synchronous part of the snapshot.
|
public SavepointSnapshotStrategy(FullSnapshotResources<K> savepointResources)
SavepointSnapshotStrategy
that writes a savepoint from the given FullSnapshotResources
.public FullSnapshotResources<K> syncPrepareResources(long checkpointId) throws Exception
SnapshotStrategy
syncPrepareResources
in interface SnapshotStrategy<KeyedStateHandle,FullSnapshotResources<K>>
checkpointId
- The ID of the checkpoint.Exception
public SnapshotStrategy.SnapshotResultSupplier<KeyedStateHandle> asyncSnapshot(FullSnapshotResources<K> savepointResources, long checkpointId, long timestamp, @Nonnull CheckpointStreamFactory streamFactory, @Nonnull CheckpointOptions checkpointOptions)
SnapshotStrategy
CheckpointStreamFactory
and returns a @SupplierWithException
that gives a state
handle to the snapshot.asyncSnapshot
in interface SnapshotStrategy<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.StateObject
.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.