Class ForStSnapshotStrategyBase<K,R extends SnapshotResources>
- java.lang.Object
-
- org.apache.flink.state.forst.snapshot.ForStSnapshotStrategyBase<K,R>
-
- Type Parameters:
K
- type of the backend keys.
- All Implemented Interfaces:
AutoCloseable
,CheckpointListener
,SnapshotStrategy<KeyedStateHandle,R>
- Direct Known Subclasses:
ForStNativeFullSnapshotStrategy
public abstract class ForStSnapshotStrategyBase<K,R extends SnapshotResources> extends Object implements CheckpointListener, SnapshotStrategy<KeyedStateHandle,R>, AutoCloseable
Abstract base class forSnapshotStrategy
implementations for ForSt state backend.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
ForStSnapshotStrategyBase.ForStNativeSnapshotResources
ASnapshotResources
for native ForSt snapshot.protected class
ForStSnapshotStrategyBase.ForStSnapshotOperation
Common operation in native ForSt snapshot result supplier.protected static class
ForStSnapshotStrategyBase.ForStSyncSnapshotResources
ASnapshotResources
for forst sync snapshot.protected static class
ForStSnapshotStrategyBase.PreviousSnapshot
Previous snapshot with uploaded sst files.-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.state.SnapshotStrategy
SnapshotStrategy.SnapshotResultSupplier<S extends StateObject>
-
-
Field Summary
Fields Modifier and Type Field Description protected UUID
backendUID
The state handle ids of all sst files materialized in snapshots for previous checkpoints.protected org.forstdb.RocksDB
db
ForSt instance from the backend.protected static ForStSnapshotStrategyBase.PreviousSnapshot
EMPTY_PREVIOUS_SNAPSHOT
protected int
keyGroupPrefixBytes
Number of bytes in the key-group prefix.protected KeyGroupRange
keyGroupRange
The key-group range for the task.protected TypeSerializer<K>
keySerializer
The key serializer of the backend.protected LinkedHashMap<String,ForStOperationUtils.ForStKvStateInfo>
kvStateInformation
Key/Value state meta info from the backend.protected ForStResourceContainer
resourceContainer
protected ResourceGuard
resourceGuard
Resource guard for the ForSt instance.
-
Constructor Summary
Constructors Constructor Description ForStSnapshotStrategyBase(String description, org.forstdb.RocksDB db, ResourceGuard resourceGuard, ForStResourceContainer resourceContainer, TypeSerializer<K> keySerializer, LinkedHashMap<String,ForStOperationUtils.ForStKvStateInfo> kvStateInformation, KeyGroupRange keyGroupRange, int keyGroupPrefixBytes, UUID backendUID)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
cleanupIncompleteSnapshot(CloseableRegistry tmpResourcesRegistry, SnapshotDirectory localBackupDirectory)
abstract void
close()
String
getDescription()
protected SnapshotResult<StreamStateHandle>
materializeMetaData(CloseableRegistry snapshotCloseableRegistry, CloseableRegistry tmpResourcesRegistry, List<StateMetaInfoSnapshot> stateMetaInfoSnapshots, long checkpointId, CheckpointStreamFactory checkpointStreamFactory)
protected abstract ForStSnapshotStrategyBase.PreviousSnapshot
snapshotMetaData(long checkpointId, List<StateMetaInfoSnapshot> stateMetaInfoSnapshots)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.api.common.state.CheckpointListener
notifyCheckpointAborted, notifyCheckpointComplete
-
Methods inherited from interface org.apache.flink.runtime.state.SnapshotStrategy
asyncSnapshot, syncPrepareResources
-
-
-
-
Field Detail
-
db
@Nonnull protected final org.forstdb.RocksDB db
ForSt instance from the backend.
-
resourceGuard
@Nonnull protected final ResourceGuard resourceGuard
Resource guard for the ForSt instance.
-
resourceContainer
@Nonnull protected final ForStResourceContainer resourceContainer
-
keySerializer
@Nonnull protected final TypeSerializer<K> keySerializer
The key serializer of the backend.
-
kvStateInformation
@Nonnull protected final LinkedHashMap<String,ForStOperationUtils.ForStKvStateInfo> kvStateInformation
Key/Value state meta info from the backend.
-
keyGroupRange
@Nonnull protected final KeyGroupRange keyGroupRange
The key-group range for the task.
-
keyGroupPrefixBytes
@Nonnegative protected final int keyGroupPrefixBytes
Number of bytes in the key-group prefix.
-
backendUID
@Nonnull protected final UUID backendUID
The state handle ids of all sst files materialized in snapshots for previous checkpoints.
-
EMPTY_PREVIOUS_SNAPSHOT
protected static final ForStSnapshotStrategyBase.PreviousSnapshot EMPTY_PREVIOUS_SNAPSHOT
-
-
Constructor Detail
-
ForStSnapshotStrategyBase
public ForStSnapshotStrategyBase(@Nonnull String description, @Nonnull org.forstdb.RocksDB db, @Nonnull ResourceGuard resourceGuard, @Nonnull ForStResourceContainer resourceContainer, @Nonnull TypeSerializer<K> keySerializer, @Nonnull LinkedHashMap<String,ForStOperationUtils.ForStKvStateInfo> kvStateInformation, @Nonnull KeyGroupRange keyGroupRange, @Nonnegative int keyGroupPrefixBytes, @Nonnull UUID backendUID)
-
-
Method Detail
-
getDescription
@Nonnull public String getDescription()
-
snapshotMetaData
protected abstract ForStSnapshotStrategyBase.PreviousSnapshot snapshotMetaData(long checkpointId, @Nonnull List<StateMetaInfoSnapshot> stateMetaInfoSnapshots)
-
materializeMetaData
@Nonnull protected SnapshotResult<StreamStateHandle> materializeMetaData(@Nonnull CloseableRegistry snapshotCloseableRegistry, @Nonnull CloseableRegistry tmpResourcesRegistry, @Nonnull List<StateMetaInfoSnapshot> stateMetaInfoSnapshots, long checkpointId, @Nonnull CheckpointStreamFactory checkpointStreamFactory) throws Exception
- Throws:
Exception
-
close
public abstract void close()
- Specified by:
close
in interfaceAutoCloseable
-
cleanupIncompleteSnapshot
protected void cleanupIncompleteSnapshot(@Nonnull CloseableRegistry tmpResourcesRegistry, @Nonnull SnapshotDirectory localBackupDirectory)
-
-