Package org.apache.flink.state.forst
Class ForStValueState<K,V>
- java.lang.Object
-
- org.apache.flink.runtime.state.v2.InternalKeyedState<K,V>
-
- org.apache.flink.runtime.state.v2.InternalValueState<K,V>
-
- org.apache.flink.state.forst.ForStValueState<K,V>
-
- Type Parameters:
K- The type of the key.V- The type of the value.
- All Implemented Interfaces:
org.apache.flink.api.common.state.v2.State,org.apache.flink.api.common.state.v2.ValueState<V>,ForStInnerTable<ContextKey<K>,V>
public class ForStValueState<K,V> extends org.apache.flink.runtime.state.v2.InternalValueState<K,V> implements org.apache.flink.api.common.state.v2.ValueState<V>, ForStInnerTable<ContextKey<K>,V>
TheInternalValueStateimplement for ForStDB.
-
-
Constructor Summary
Constructors Constructor Description ForStValueState(org.apache.flink.runtime.asyncprocessing.StateRequestHandler stateRequestHandler, org.rocksdb.ColumnFamilyHandle columnFamily, org.apache.flink.runtime.state.v2.ValueStateDescriptor<V> valueStateDescriptor, java.util.function.Supplier<org.apache.flink.runtime.state.SerializedCompositeKeyBuilder<K>> serializedKeyBuilderInitializer, java.util.function.Supplier<org.apache.flink.core.memory.DataOutputSerializer> valueSerializerViewInitializer, java.util.function.Supplier<org.apache.flink.core.memory.DataInputDeserializer> valueDeserializerViewInitializer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ForStDBGetRequest<ContextKey<K>,V>buildDBGetRequest(org.apache.flink.runtime.asyncprocessing.StateRequest<?,?,?> stateRequest)Build aForStDBGetRequestthat belong to thisForStInnerTablewith the given stateRequest.ForStDBPutRequest<ContextKey<K>,V>buildDBPutRequest(org.apache.flink.runtime.asyncprocessing.StateRequest<?,?,?> stateRequest)Build aForStDBPutRequestthat belong toForStInnerTablewith the given stateRequest.VdeserializeValue(byte[] valueBytes)Deserialize the given bytes value to POJO value.org.rocksdb.ColumnFamilyHandlegetColumnFamilyHandle()Get the columnFamily handle corresponding to table.byte[]serializeKey(ContextKey<K> contextKey)Serialize the given key to bytes.byte[]serializeValue(V value)Serialize the given value to the outputView.-
Methods inherited from class org.apache.flink.runtime.state.v2.InternalValueState
asyncUpdate, asyncValue
-
Methods inherited from class org.apache.flink.runtime.state.v2.InternalKeyedState
asyncClear, getStateDescriptor, getValueSerializer, handleRequest
-
-
-
-
Constructor Detail
-
ForStValueState
public ForStValueState(org.apache.flink.runtime.asyncprocessing.StateRequestHandler stateRequestHandler, org.rocksdb.ColumnFamilyHandle columnFamily, org.apache.flink.runtime.state.v2.ValueStateDescriptor<V> valueStateDescriptor, java.util.function.Supplier<org.apache.flink.runtime.state.SerializedCompositeKeyBuilder<K>> serializedKeyBuilderInitializer, java.util.function.Supplier<org.apache.flink.core.memory.DataOutputSerializer> valueSerializerViewInitializer, java.util.function.Supplier<org.apache.flink.core.memory.DataInputDeserializer> valueDeserializerViewInitializer)
-
-
Method Detail
-
getColumnFamilyHandle
public org.rocksdb.ColumnFamilyHandle getColumnFamilyHandle()
Description copied from interface:ForStInnerTableGet the columnFamily handle corresponding to table.- Specified by:
getColumnFamilyHandlein interfaceForStInnerTable<K,V>
-
serializeKey
public byte[] serializeKey(ContextKey<K> contextKey) throws IOException
Description copied from interface:ForStInnerTableSerialize the given key to bytes.- Specified by:
serializeKeyin interfaceForStInnerTable<K,V>- Parameters:
contextKey- the key to be serialized.- Returns:
- the key bytes
- Throws:
IOException- Thrown if the serialization encountered an I/O related error.
-
serializeValue
public byte[] serializeValue(V value) throws IOException
Description copied from interface:ForStInnerTableSerialize the given value to the outputView.- Specified by:
serializeValuein interfaceForStInnerTable<K,V>- Parameters:
value- the value to be serialized.- Returns:
- the value bytes
- Throws:
IOException- Thrown if the serialization encountered an I/O related error.
-
deserializeValue
public V deserializeValue(byte[] valueBytes) throws IOException
Description copied from interface:ForStInnerTableDeserialize the given bytes value to POJO value.- Specified by:
deserializeValuein interfaceForStInnerTable<K,V>- Parameters:
valueBytes- the value bytes to be deserialized.- Returns:
- the deserialized POJO value
- Throws:
IOException- Thrown if the deserialization encountered an I/O related error.
-
buildDBGetRequest
public ForStDBGetRequest<ContextKey<K>,V> buildDBGetRequest(org.apache.flink.runtime.asyncprocessing.StateRequest<?,?,?> stateRequest)
Description copied from interface:ForStInnerTableBuild aForStDBGetRequestthat belong to thisForStInnerTablewith the given stateRequest.- Specified by:
buildDBGetRequestin interfaceForStInnerTable<K,V>- Parameters:
stateRequest- The given stateRequest.- Returns:
- The corresponding ForSt GetRequest.
-
buildDBPutRequest
public ForStDBPutRequest<ContextKey<K>,V> buildDBPutRequest(org.apache.flink.runtime.asyncprocessing.StateRequest<?,?,?> stateRequest)
Description copied from interface:ForStInnerTableBuild aForStDBPutRequestthat belong toForStInnerTablewith the given stateRequest.- Specified by:
buildDBPutRequestin interfaceForStInnerTable<K,V>- Parameters:
stateRequest- The given stateRequest.- Returns:
- The corresponding ForSt PutRequest.
-
-