Package org.apache.flink.state.forst
Class ForStMapState<K,N,UK,UV>
java.lang.Object
org.apache.flink.runtime.state.v2.AbstractKeyedState<K,N,V>
org.apache.flink.runtime.state.v2.AbstractMapState<K,N,UK,UV>
org.apache.flink.state.forst.ForStMapState<K,N,UK,UV>
- Type Parameters:
K- The type of the key.N- The type of the namespace.UK- The type of the user key.UV- The type of the user value.
- All Implemented Interfaces:
org.apache.flink.api.common.state.v2.MapState<UK,,UV> org.apache.flink.api.common.state.v2.State,org.apache.flink.runtime.state.v2.internal.InternalKeyedState<K,,N, UV> org.apache.flink.runtime.state.v2.internal.InternalMapState<K,,N, UK, UV> org.apache.flink.runtime.state.v2.internal.InternalPartitionedState<N>,ForStInnerTable<K,N, UV>
public class ForStMapState<K,N,UK,UV>
extends org.apache.flink.runtime.state.v2.AbstractMapState<K,N,UK,UV>
implements org.apache.flink.api.common.state.v2.MapState<UK,UV>, ForStInnerTable<K,N,UV>
The
AbstractMapState implement for ForStDB.-
Field Summary
Fields inherited from class org.apache.flink.runtime.state.v2.AbstractKeyedState
stateRequestHandler -
Constructor Summary
ConstructorsConstructorDescriptionForStMapState(org.apache.flink.runtime.asyncprocessing.StateRequestHandler stateRequestHandler, org.forstdb.ColumnFamilyHandle columnFamily, org.apache.flink.api.common.state.v2.MapStateDescriptor<UK, UV> stateDescriptor, Supplier<org.apache.flink.runtime.state.SerializedCompositeKeyBuilder<K>> serializedKeyBuilderInitializer, N defaultNamespace, Supplier<org.apache.flink.api.common.typeutils.TypeSerializer<N>> namespaceSerializerInitializer, Supplier<org.apache.flink.core.memory.DataOutputSerializer> valueSerializerViewInitializer, Supplier<org.apache.flink.core.memory.DataInputDeserializer> keyDeserializerViewInitializer, Supplier<org.apache.flink.core.memory.DataInputDeserializer> valueDeserializerViewInitializer, int keyGroupPrefixBytes) -
Method Summary
Modifier and TypeMethodDescriptionbuildDBBunchPutRequest(org.apache.flink.runtime.asyncprocessing.StateRequest<?, ?, ?, ?> stateRequest) Build a request for bunch put.ForStDBGetRequest<?,?, ?, ?> buildDBGetRequest(org.apache.flink.runtime.asyncprocessing.StateRequest<?, ?, ?, ?> stateRequest) Build aForStDBGetRequestthat belong to thisForStInnerTablewith the given stateRequest.ForStDBIterRequest<K,N, UK, UV, ?> buildDBIterRequest(org.apache.flink.runtime.asyncprocessing.StateRequest<?, ?, ?, ?> stateRequest) Build a request for iterator.buildDBPutRequest(org.apache.flink.runtime.asyncprocessing.StateRequest<?, ?, ?, ?> stateRequest) Build aForStDBPutRequestthat belong toForStInnerTablewith the given stateRequest.deserializeUserKey(byte[] userKeyBytes, int userKeyOffset) deserializeValue(byte[] valueBytes) Deserialize the given bytes value to POJO value.org.forstdb.ColumnFamilyHandleGet the columnFamily handle corresponding to table.intbyte[]serializeKey(ContextKey<K, N> contextKey) Serialize the given key to bytes.byte[]serializeValue(UV value) Serialize the given value to the outputView.Methods inherited from class org.apache.flink.runtime.state.v2.AbstractMapState
asyncContains, asyncEntries, asyncGet, asyncIsEmpty, asyncKeys, asyncPut, asyncPutAll, asyncRemove, asyncValues, contains, entries, get, isEmpty, iterator, keys, put, putAll, remove, valuesMethods inherited from class org.apache.flink.runtime.state.v2.AbstractKeyedState
asyncClear, clear, getStateDescriptor, getStateRequestHandler, getValueSerializer, handleRequest, handleRequestSync, setCurrentNamespaceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.runtime.state.v2.internal.InternalPartitionedState
setCurrentNamespaceMethods inherited from interface org.apache.flink.api.common.state.v2.MapState
asyncContains, asyncEntries, asyncGet, asyncIsEmpty, asyncKeys, asyncPut, asyncPutAll, asyncRemove, asyncValues, contains, entries, get, isEmpty, iterator, keys, put, putAll, remove, valuesMethods inherited from interface org.apache.flink.api.common.state.v2.State
asyncClear, clear
-
Constructor Details
-
ForStMapState
public ForStMapState(org.apache.flink.runtime.asyncprocessing.StateRequestHandler stateRequestHandler, org.forstdb.ColumnFamilyHandle columnFamily, org.apache.flink.api.common.state.v2.MapStateDescriptor<UK, UV> stateDescriptor, Supplier<org.apache.flink.runtime.state.SerializedCompositeKeyBuilder<K>> serializedKeyBuilderInitializer, N defaultNamespace, Supplier<org.apache.flink.api.common.typeutils.TypeSerializer<N>> namespaceSerializerInitializer, Supplier<org.apache.flink.core.memory.DataOutputSerializer> valueSerializerViewInitializer, Supplier<org.apache.flink.core.memory.DataInputDeserializer> keyDeserializerViewInitializer, Supplier<org.apache.flink.core.memory.DataInputDeserializer> valueDeserializerViewInitializer, int keyGroupPrefixBytes)
-
-
Method Details
-
getKeyGroupPrefixBytes
public int getKeyGroupPrefixBytes() -
getColumnFamilyHandle
public org.forstdb.ColumnFamilyHandle getColumnFamilyHandle()Description copied from interface:ForStInnerTableGet the columnFamily handle corresponding to table.- Specified by:
getColumnFamilyHandlein interfaceForStInnerTable<K,N, UK>
-
serializeKey
Description copied from interface:ForStInnerTableSerialize the given key to bytes.- Specified by:
serializeKeyin interfaceForStInnerTable<K,N, UK> - Parameters:
contextKey- the key to be serialized.- Returns:
- the key bytes
- Throws:
IOException- Thrown if the serialization encountered an I/O related error.
-
serializeValue
Description copied from interface:ForStInnerTableSerialize the given value to the outputView.- Specified by:
serializeValuein interfaceForStInnerTable<K,N, UK> - Parameters:
value- the value to be serialized.- Returns:
- the value bytes
- Throws:
IOException- Thrown if the serialization encountered an I/O related error.
-
deserializeValue
Description copied from interface:ForStInnerTableDeserialize the given bytes value to POJO value.- Specified by:
deserializeValuein interfaceForStInnerTable<K,N, UK> - 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.
-
deserializeUserKey
- Throws:
IOException
-
buildDBGetRequest
public ForStDBGetRequest<?,?, 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,N, UK> - Parameters:
stateRequest- The given stateRequest.- Returns:
- The corresponding ForSt GetRequest.
-
buildDBPutRequest
public ForStDBPutRequest<K,N, buildDBPutRequestUV> (org.apache.flink.runtime.asyncprocessing.StateRequest<?, ?, ?, ?> stateRequest) Description copied from interface:ForStInnerTableBuild aForStDBPutRequestthat belong toForStInnerTablewith the given stateRequest.- Specified by:
buildDBPutRequestin interfaceForStInnerTable<K,N, UK> - Parameters:
stateRequest- The given stateRequest.- Returns:
- The corresponding ForSt PutRequest.
-
buildDBBunchPutRequest
public ForStDBBunchPutRequest<K,N, buildDBBunchPutRequestUK, UV> (org.apache.flink.runtime.asyncprocessing.StateRequest<?, ?, ?, ?> stateRequest) Build a request for bunch put. Maily used forStateRequestType.MAP_PUT_ALLandStateRequestType.CLEAR.- Parameters:
stateRequest- The state request.- Returns:
- The
ForStDBBunchPutRequest.
-
buildDBIterRequest
public ForStDBIterRequest<K,N, buildDBIterRequestUK, UV, ?> (org.apache.flink.runtime.asyncprocessing.StateRequest<?, ?, ?, ?> stateRequest) Build a request for iterator. Used forStateRequestType.MAP_ITER,StateRequestType.MAP_ITER_KEY,StateRequestType.MAP_ITER_VALUEandStateRequestType.ITERATOR_LOADING.- Parameters:
stateRequest- The state request.- Returns:
- The
ForStDBIterRequest.
-