public class ForStKeyedStateBackend<K> extends Object implements AsyncKeyedStateBackend
ForSt
. This state backend can store very
large state that exceeds memory even disk to remote storage.Modifier and Type | Field and Description |
---|---|
protected org.rocksdb.RocksDB |
db
Our ForSt database.
|
protected TypeSerializer<K> |
keySerializer
The key serializer.
|
Constructor and Description |
---|
ForStKeyedStateBackend(ForStResourceContainer optionsContainer,
TypeSerializer<K> keySerializer,
Supplier<SerializedCompositeKeyBuilder<K>> serializedKeyBuilder,
Supplier<DataOutputSerializer> valueSerializerView,
Supplier<DataInputDeserializer> valueDeserializerView,
org.rocksdb.RocksDB db,
Function<String,org.rocksdb.ColumnFamilyOptions> columnFamilyOptionsFactory,
org.rocksdb.ColumnFamilyHandle defaultColumnFamilyHandle,
ForStNativeMetricMonitor nativeMetricMonitor) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
<SV,S extends State> |
createState(StateDescriptor<SV> stateDesc)
Creates and returns a new state.
|
StateExecutor |
createStateExecutor()
Creates a
StateExecutor which supports to execute a batch of state requests
asynchronously. |
void |
dispose()
Should only be called by one thread, and only after all accesses to the DB happened.
|
void |
setup(StateRequestHandler stateRequestHandler)
Initializes with some contexts.
|
protected final TypeSerializer<K> keySerializer
protected final org.rocksdb.RocksDB db
public ForStKeyedStateBackend(ForStResourceContainer optionsContainer, TypeSerializer<K> keySerializer, Supplier<SerializedCompositeKeyBuilder<K>> serializedKeyBuilder, Supplier<DataOutputSerializer> valueSerializerView, Supplier<DataInputDeserializer> valueDeserializerView, org.rocksdb.RocksDB db, Function<String,org.rocksdb.ColumnFamilyOptions> columnFamilyOptionsFactory, org.rocksdb.ColumnFamilyHandle defaultColumnFamilyHandle, ForStNativeMetricMonitor nativeMetricMonitor)
public void setup(@Nonnull StateRequestHandler stateRequestHandler)
AsyncKeyedStateBackend
setup
in interface AsyncKeyedStateBackend
stateRequestHandler
- which handles state request.@Nonnull public <SV,S extends State> S createState(@Nonnull StateDescriptor<SV> stateDesc)
AsyncKeyedStateBackend
createState
in interface AsyncKeyedStateBackend
SV
- The type of the stored state value.S
- The type of the public API state.stateDesc
- The StateDescriptor
that contains the name of the state.@Nonnull public StateExecutor createStateExecutor()
AsyncKeyedStateBackend
StateExecutor
which supports to execute a batch of state requests
asynchronously.
Notice that the AsyncKeyedStateBackend
is responsible for shutting down the
StateExecutors created by itself when they are no longer in use.
createStateExecutor
in interface AsyncKeyedStateBackend
StateExecutor
which supports to execute a batch of state requests
asynchronously.public void dispose()
dispose
in interface AsyncKeyedStateBackend
dispose
in interface Disposable
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.