Package org.apache.flink.state.forst
Class ForStKeyedStateBackend<K>
- java.lang.Object
-
- org.apache.flink.state.forst.ForStKeyedStateBackend<K>
-
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.flink.runtime.state.AsyncKeyedStateBackend,org.apache.flink.util.Disposable
public class ForStKeyedStateBackend<K> extends Object implements org.apache.flink.runtime.state.AsyncKeyedStateBackend
A KeyedStateBackend that stores its state inForSt. This state backend can store very large state that exceeds memory even disk to remote storage.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.rocksdb.RocksDBdbOur ForSt database.protected org.apache.flink.api.common.typeutils.TypeSerializer<K>keySerializerThe key serializer.
-
Constructor Summary
Constructors Constructor Description ForStKeyedStateBackend(ForStResourceContainer optionsContainer, org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, java.util.function.Supplier<org.apache.flink.runtime.state.SerializedCompositeKeyBuilder<K>> serializedKeyBuilder, java.util.function.Supplier<org.apache.flink.core.memory.DataOutputSerializer> valueSerializerView, java.util.function.Supplier<org.apache.flink.core.memory.DataInputDeserializer> valueDeserializerView, org.rocksdb.RocksDB db, java.util.function.Function<String,org.rocksdb.ColumnFamilyOptions> columnFamilyOptionsFactory, org.rocksdb.ColumnFamilyHandle defaultColumnFamilyHandle, ForStNativeMetricMonitor nativeMetricMonitor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()<SV,S extends org.apache.flink.api.common.state.v2.State>
ScreateState(org.apache.flink.runtime.state.v2.StateDescriptor<SV> stateDesc)org.apache.flink.runtime.asyncprocessing.StateExecutorcreateStateExecutor()voiddispose()Should only be called by one thread, and only after all accesses to the DB happened.voidsetup(org.apache.flink.runtime.asyncprocessing.StateRequestHandler stateRequestHandler)
-
-
-
Field Detail
-
keySerializer
protected final org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer
The key serializer.
-
db
protected final org.rocksdb.RocksDB db
Our ForSt database. The different k/v states that we have don't each have their own ForSt instance. They all write to this instance but to their own column family.
-
-
Constructor Detail
-
ForStKeyedStateBackend
public ForStKeyedStateBackend(ForStResourceContainer optionsContainer, org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, java.util.function.Supplier<org.apache.flink.runtime.state.SerializedCompositeKeyBuilder<K>> serializedKeyBuilder, java.util.function.Supplier<org.apache.flink.core.memory.DataOutputSerializer> valueSerializerView, java.util.function.Supplier<org.apache.flink.core.memory.DataInputDeserializer> valueDeserializerView, org.rocksdb.RocksDB db, java.util.function.Function<String,org.rocksdb.ColumnFamilyOptions> columnFamilyOptionsFactory, org.rocksdb.ColumnFamilyHandle defaultColumnFamilyHandle, ForStNativeMetricMonitor nativeMetricMonitor)
-
-
Method Detail
-
setup
public void setup(@Nonnull org.apache.flink.runtime.asyncprocessing.StateRequestHandler stateRequestHandler)
- Specified by:
setupin interfaceorg.apache.flink.runtime.state.AsyncKeyedStateBackend
-
createState
@Nonnull public <SV,S extends org.apache.flink.api.common.state.v2.State> S createState(@Nonnull org.apache.flink.runtime.state.v2.StateDescriptor<SV> stateDesc)
- Specified by:
createStatein interfaceorg.apache.flink.runtime.state.AsyncKeyedStateBackend
-
createStateExecutor
@Nonnull public org.apache.flink.runtime.asyncprocessing.StateExecutor createStateExecutor()
- Specified by:
createStateExecutorin interfaceorg.apache.flink.runtime.state.AsyncKeyedStateBackend
-
dispose
public void dispose()
Should only be called by one thread, and only after all accesses to the DB happened.- Specified by:
disposein interfaceorg.apache.flink.runtime.state.AsyncKeyedStateBackend- Specified by:
disposein interfaceorg.apache.flink.util.Disposable
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-