K - type of the backend keys.public abstract class RocksDBSnapshotStrategyBase<K>
extends org.apache.flink.runtime.state.AbstractSnapshotStrategy<org.apache.flink.runtime.state.KeyedStateHandle>
implements org.apache.flink.runtime.state.CheckpointListener
SnapshotStrategy implementations for RocksDB state backend.| Modifier and Type | Field and Description |
|---|---|
protected org.apache.flink.core.fs.CloseableRegistry |
cancelStreamRegistry
A
CloseableRegistry that will be closed when the task is cancelled. |
protected org.rocksdb.RocksDB |
db
RocksDB instance from the backend.
|
protected int |
keyGroupPrefixBytes
Number of bytes in the key-group prefix.
|
protected org.apache.flink.runtime.state.KeyGroupRange |
keyGroupRange
The key-group range for the task.
|
protected org.apache.flink.api.common.typeutils.TypeSerializer<K> |
keySerializer
The key serializer of the backend.
|
protected LinkedHashMap<String,RocksDBKeyedStateBackend.RocksDbKvStateInfo> |
kvStateInformation
Key/Value state meta info from the backend.
|
protected org.apache.flink.runtime.state.LocalRecoveryConfig |
localRecoveryConfig
The configuration for local recovery.
|
protected org.apache.flink.util.ResourceGuard |
rocksDBResourceGuard
Resource guard for the RocksDB instance.
|
| Constructor and Description |
|---|
RocksDBSnapshotStrategyBase(String description,
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,
org.apache.flink.core.fs.CloseableRegistry cancelStreamRegistry) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract RunnableFuture<org.apache.flink.runtime.state.SnapshotResult<org.apache.flink.runtime.state.KeyedStateHandle>> |
doSnapshot(long checkpointId,
long timestamp,
org.apache.flink.runtime.state.CheckpointStreamFactory streamFactory,
org.apache.flink.runtime.checkpoint.CheckpointOptions checkpointOptions)
This method implements the concrete snapshot logic for a non-empty state.
|
RunnableFuture<org.apache.flink.runtime.state.SnapshotResult<org.apache.flink.runtime.state.KeyedStateHandle>> |
snapshot(long checkpointId,
long timestamp,
org.apache.flink.runtime.state.CheckpointStreamFactory streamFactory,
org.apache.flink.runtime.checkpoint.CheckpointOptions checkpointOptions) |
logAsyncCompleted, logSyncCompleted, toString@Nonnull protected org.rocksdb.RocksDB db
@Nonnull protected final org.apache.flink.util.ResourceGuard rocksDBResourceGuard
@Nonnull protected final org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer
@Nonnull protected final LinkedHashMap<String,RocksDBKeyedStateBackend.RocksDbKvStateInfo> kvStateInformation
@Nonnull protected final org.apache.flink.runtime.state.KeyGroupRange keyGroupRange
@Nonnegative protected final int keyGroupPrefixBytes
@Nonnull protected final org.apache.flink.runtime.state.LocalRecoveryConfig localRecoveryConfig
@Nonnull protected final org.apache.flink.core.fs.CloseableRegistry cancelStreamRegistry
CloseableRegistry that will be closed when the task is cancelled.public RocksDBSnapshotStrategyBase(@Nonnull String description, @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 org.apache.flink.core.fs.CloseableRegistry cancelStreamRegistry)
@Nonnull public final RunnableFuture<org.apache.flink.runtime.state.SnapshotResult<org.apache.flink.runtime.state.KeyedStateHandle>> snapshot(long checkpointId, long timestamp, @Nonnull org.apache.flink.runtime.state.CheckpointStreamFactory streamFactory, @Nonnull org.apache.flink.runtime.checkpoint.CheckpointOptions checkpointOptions) throws Exception
snapshot in interface org.apache.flink.runtime.state.SnapshotStrategy<org.apache.flink.runtime.state.SnapshotResult<org.apache.flink.runtime.state.KeyedStateHandle>>Exception@Nonnull protected abstract RunnableFuture<org.apache.flink.runtime.state.SnapshotResult<org.apache.flink.runtime.state.KeyedStateHandle>> doSnapshot(long checkpointId, long timestamp, org.apache.flink.runtime.state.CheckpointStreamFactory streamFactory, org.apache.flink.runtime.checkpoint.CheckpointOptions checkpointOptions) throws Exception
ExceptionCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.