Class RocksIncrementalSnapshotStrategy<K>
- java.lang.Object
-
- org.apache.flink.contrib.streaming.state.snapshot.RocksDBSnapshotStrategyBase<K,RocksDBSnapshotStrategyBase.NativeRocksDBSnapshotResources>
-
- org.apache.flink.contrib.streaming.state.snapshot.RocksIncrementalSnapshotStrategy<K>
-
- Type Parameters:
K- type of the backend keys.
- All Implemented Interfaces:
AutoCloseable,org.apache.flink.api.common.state.CheckpointListener,org.apache.flink.runtime.state.SnapshotStrategy<org.apache.flink.runtime.state.KeyedStateHandle,RocksDBSnapshotStrategyBase.NativeRocksDBSnapshotResources>
public class RocksIncrementalSnapshotStrategy<K> extends RocksDBSnapshotStrategyBase<K,RocksDBSnapshotStrategyBase.NativeRocksDBSnapshotResources>
Snapshot strategy forRocksDBKeyedStateBackendthat is based on RocksDB's native checkpoints and creates incremental snapshots.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.contrib.streaming.state.snapshot.RocksDBSnapshotStrategyBase
RocksDBSnapshotStrategyBase.NativeRocksDBSnapshotResources, RocksDBSnapshotStrategyBase.PreviousSnapshot, RocksDBSnapshotStrategyBase.RocksDBSnapshotOperation
-
-
Field Summary
-
Fields inherited from class org.apache.flink.contrib.streaming.state.snapshot.RocksDBSnapshotStrategyBase
backendUID, db, EMPTY_PREVIOUS_SNAPSHOT, instanceBasePath, keyGroupPrefixBytes, keyGroupRange, keySerializer, kvStateInformation, localDirectoryName, localRecoveryConfig, rocksDBResourceGuard
-
-
Constructor Summary
Constructors Constructor Description RocksIncrementalSnapshotStrategy(org.rocksdb.RocksDB db, org.apache.flink.util.ResourceGuard rocksDBResourceGuard, org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, LinkedHashMap<String,RocksDBKeyedStateBackend.RocksDbKvStateInfo> kvStateInformation, org.apache.flink.runtime.state.KeyGroupRange keyGroupRange, int keyGroupPrefixBytes, org.apache.flink.runtime.state.LocalRecoveryConfig localRecoveryConfig, File instanceBasePath, UUID backendUID, SortedMap<Long,Collection<org.apache.flink.runtime.state.IncrementalKeyedStateHandle.HandleAndLocalPath>> uploadedStateHandles, RocksDBStateUploader rocksDBStateUploader, long lastCompletedCheckpointId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.flink.runtime.state.SnapshotStrategy.SnapshotResultSupplier<org.apache.flink.runtime.state.KeyedStateHandle>asyncSnapshot(RocksDBSnapshotStrategyBase.NativeRocksDBSnapshotResources snapshotResources, long checkpointId, long timestamp, org.apache.flink.runtime.state.CheckpointStreamFactory checkpointStreamFactory, org.apache.flink.runtime.checkpoint.CheckpointOptions checkpointOptions)voidclose()voidnotifyCheckpointAborted(long abortedCheckpointId)voidnotifyCheckpointComplete(long completedCheckpointId)protected RocksDBSnapshotStrategyBase.PreviousSnapshotsnapshotMetaData(long checkpointId, List<org.apache.flink.runtime.state.metainfo.StateMetaInfoSnapshot> stateMetaInfoSnapshots)-
Methods inherited from class org.apache.flink.contrib.streaming.state.snapshot.RocksDBSnapshotStrategyBase
cleanupIncompleteSnapshot, getDescription, materializeMetaData, prepareLocalSnapshotDirectory, syncPrepareResources
-
-
-
-
Constructor Detail
-
RocksIncrementalSnapshotStrategy
public RocksIncrementalSnapshotStrategy(@Nonnull org.rocksdb.RocksDB db, @Nonnull org.apache.flink.util.ResourceGuard rocksDBResourceGuard, @Nonnull org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, @Nonnull LinkedHashMap<String,RocksDBKeyedStateBackend.RocksDbKvStateInfo> kvStateInformation, @Nonnull org.apache.flink.runtime.state.KeyGroupRange keyGroupRange, @Nonnegative int keyGroupPrefixBytes, @Nonnull org.apache.flink.runtime.state.LocalRecoveryConfig localRecoveryConfig, @Nonnull File instanceBasePath, @Nonnull UUID backendUID, @Nonnull SortedMap<Long,Collection<org.apache.flink.runtime.state.IncrementalKeyedStateHandle.HandleAndLocalPath>> uploadedStateHandles, @Nonnull RocksDBStateUploader rocksDBStateUploader, long lastCompletedCheckpointId)
-
-
Method Detail
-
asyncSnapshot
public org.apache.flink.runtime.state.SnapshotStrategy.SnapshotResultSupplier<org.apache.flink.runtime.state.KeyedStateHandle> asyncSnapshot(RocksDBSnapshotStrategyBase.NativeRocksDBSnapshotResources snapshotResources, long checkpointId, long timestamp, @Nonnull org.apache.flink.runtime.state.CheckpointStreamFactory checkpointStreamFactory, @Nonnull org.apache.flink.runtime.checkpoint.CheckpointOptions checkpointOptions)
-
notifyCheckpointComplete
public void notifyCheckpointComplete(long completedCheckpointId)
-
notifyCheckpointAborted
public void notifyCheckpointAborted(long abortedCheckpointId)
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein classRocksDBSnapshotStrategyBase<K,RocksDBSnapshotStrategyBase.NativeRocksDBSnapshotResources>- Throws:
IOException
-
snapshotMetaData
protected RocksDBSnapshotStrategyBase.PreviousSnapshot snapshotMetaData(long checkpointId, @Nonnull List<org.apache.flink.runtime.state.metainfo.StateMetaInfoSnapshot> stateMetaInfoSnapshots)
- Specified by:
snapshotMetaDatain classRocksDBSnapshotStrategyBase<K,RocksDBSnapshotStrategyBase.NativeRocksDBSnapshotResources>
-
-