K
- type of the backend keys.public abstract class RocksDBSnapshotStrategyBase<K,R extends SnapshotResources> extends Object implements CheckpointListener, SnapshotStrategy<KeyedStateHandle,RocksDBSnapshotStrategyBase.NativeRocksDBSnapshotResources>, AutoCloseable
SnapshotStrategy
implementations for RocksDB state backend.Modifier and Type | Class and Description |
---|---|
protected static class |
RocksDBSnapshotStrategyBase.NativeRocksDBSnapshotResources
A
SnapshotResources for native rocksdb snapshot. |
protected static class |
RocksDBSnapshotStrategyBase.PreviousSnapshot
Previous snapshot with uploaded sst files.
|
protected class |
RocksDBSnapshotStrategyBase.RocksDBSnapshotOperation
Common operation in native rocksdb snapshot result supplier.
|
SnapshotStrategy.SnapshotResultSupplier<S extends StateObject>
Modifier and Type | Field and Description |
---|---|
protected UUID |
backendUID
The state handle ids of all sst files materialized in snapshots for previous checkpoints.
|
protected org.rocksdb.RocksDB |
db
RocksDB instance from the backend.
|
protected static RocksDBSnapshotStrategyBase.PreviousSnapshot |
EMPTY_PREVIOUS_SNAPSHOT |
protected File |
instanceBasePath
Base path of the RocksDB instance.
|
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,RocksDBKeyedStateBackend.RocksDbKvStateInfo> |
kvStateInformation
Key/Value state meta info from the backend.
|
protected String |
localDirectoryName
The local directory name of the current snapshot strategy.
|
protected LocalRecoveryConfig |
localRecoveryConfig
The configuration for local recovery.
|
protected ResourceGuard |
rocksDBResourceGuard
Resource guard for the RocksDB instance.
|
Constructor and Description |
---|
RocksDBSnapshotStrategyBase(String description,
org.rocksdb.RocksDB db,
ResourceGuard rocksDBResourceGuard,
TypeSerializer<K> keySerializer,
LinkedHashMap<String,RocksDBKeyedStateBackend.RocksDbKvStateInfo> kvStateInformation,
KeyGroupRange keyGroupRange,
int keyGroupPrefixBytes,
LocalRecoveryConfig localRecoveryConfig,
File instanceBasePath,
UUID backendUID) |
Modifier and Type | Method and 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 SnapshotDirectory |
prepareLocalSnapshotDirectory(long checkpointId) |
protected abstract RocksDBSnapshotStrategyBase.PreviousSnapshot |
snapshotMetaData(long checkpointId,
List<StateMetaInfoSnapshot> stateMetaInfoSnapshots) |
RocksDBSnapshotStrategyBase.NativeRocksDBSnapshotResources |
syncPrepareResources(long checkpointId)
Performs the synchronous part of the snapshot.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
notifyCheckpointAborted, notifyCheckpointComplete
asyncSnapshot
@Nonnull protected org.rocksdb.RocksDB db
@Nonnull protected final ResourceGuard rocksDBResourceGuard
@Nonnull protected final TypeSerializer<K> keySerializer
@Nonnull protected final LinkedHashMap<String,RocksDBKeyedStateBackend.RocksDbKvStateInfo> kvStateInformation
@Nonnull protected final KeyGroupRange keyGroupRange
@Nonnegative protected final int keyGroupPrefixBytes
@Nonnull protected final LocalRecoveryConfig localRecoveryConfig
protected final String localDirectoryName
@Nonnull protected final UUID backendUID
protected static final RocksDBSnapshotStrategyBase.PreviousSnapshot EMPTY_PREVIOUS_SNAPSHOT
public RocksDBSnapshotStrategyBase(@Nonnull String description, @Nonnull org.rocksdb.RocksDB db, @Nonnull ResourceGuard rocksDBResourceGuard, @Nonnull TypeSerializer<K> keySerializer, @Nonnull LinkedHashMap<String,RocksDBKeyedStateBackend.RocksDbKvStateInfo> kvStateInformation, @Nonnull KeyGroupRange keyGroupRange, @Nonnegative int keyGroupPrefixBytes, @Nonnull LocalRecoveryConfig localRecoveryConfig, @Nonnull File instanceBasePath, @Nonnull UUID backendUID)
public RocksDBSnapshotStrategyBase.NativeRocksDBSnapshotResources syncPrepareResources(long checkpointId) throws Exception
SnapshotStrategy
syncPrepareResources
in interface SnapshotStrategy<KeyedStateHandle,RocksDBSnapshotStrategyBase.NativeRocksDBSnapshotResources>
checkpointId
- The ID of the checkpoint.Exception
protected abstract RocksDBSnapshotStrategyBase.PreviousSnapshot snapshotMetaData(long checkpointId, @Nonnull List<StateMetaInfoSnapshot> stateMetaInfoSnapshots)
@Nonnull protected SnapshotDirectory prepareLocalSnapshotDirectory(long checkpointId) throws IOException
IOException
protected void cleanupIncompleteSnapshot(@Nonnull CloseableRegistry tmpResourcesRegistry, @Nonnull SnapshotDirectory localBackupDirectory)
@Nonnull protected SnapshotResult<StreamStateHandle> materializeMetaData(@Nonnull CloseableRegistry snapshotCloseableRegistry, @Nonnull CloseableRegistry tmpResourcesRegistry, @Nonnull List<StateMetaInfoSnapshot> stateMetaInfoSnapshots, long checkpointId, @Nonnull CheckpointStreamFactory checkpointStreamFactory) throws Exception
Exception
public abstract void close()
close
in interface AutoCloseable
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.