Package org.apache.flink.state.forst
Class ForStListState<K,N,V>
java.lang.Object
org.apache.flink.runtime.state.v2.AbstractKeyedState<K,N,V>
org.apache.flink.runtime.state.v2.AbstractListState<K,N,V>
org.apache.flink.state.forst.ForStListState<K,N,V>
- Type Parameters:
K- The type of the key.N- The type of the namespace.V- The type of the value.
- All Implemented Interfaces:
org.apache.flink.api.common.state.v2.AppendingState<V,,org.apache.flink.api.common.state.v2.StateIterator<V>, Iterable<V>> org.apache.flink.api.common.state.v2.ListState<V>,org.apache.flink.api.common.state.v2.MergingState<V,,org.apache.flink.api.common.state.v2.StateIterator<V>, Iterable<V>> org.apache.flink.api.common.state.v2.State,org.apache.flink.runtime.state.v2.internal.InternalAppendingState<K,,N, V, V, org.apache.flink.api.common.state.v2.StateIterator<V>, Iterable<V>> org.apache.flink.runtime.state.v2.internal.InternalKeyedState<K,,N, V> org.apache.flink.runtime.state.v2.internal.InternalListState<K,,N, V> org.apache.flink.runtime.state.v2.internal.InternalMergingState<K,,N, V, V, org.apache.flink.api.common.state.v2.StateIterator<V>, Iterable<V>> org.apache.flink.runtime.state.v2.internal.InternalPartitionedState<N>,ForStInnerTable<K,N, List<V>>
public class ForStListState<K,N,V>
extends org.apache.flink.runtime.state.v2.AbstractListState<K,N,V>
implements org.apache.flink.api.common.state.v2.ListState<V>, ForStInnerTable<K,N,List<V>>
The
AbstractListState implement for ForStDB.
ForStStateBackend must ensure that we set the StringAppendOperator
on the column family that we use for our state since we use the merge() call.
-
Field Summary
Fields inherited from class org.apache.flink.runtime.state.v2.AbstractKeyedState
stateRequestHandler -
Constructor Summary
ConstructorsConstructorDescriptionForStListState(org.apache.flink.runtime.asyncprocessing.StateRequestHandler stateRequestHandler, org.forstdb.ColumnFamilyHandle columnFamily, org.apache.flink.api.common.state.v2.ListStateDescriptor<V> listStateDescriptor, 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> valueDeserializerViewInitializer) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.flink.api.common.state.v2.StateFuture<Void>asyncMergeNamespaces(N target, Collection<N> sources) ForStDBGetRequest<K,N, List<V>, ?> buildDBGetRequest(org.apache.flink.runtime.asyncprocessing.StateRequest<?, ?, ?, ?> stateRequest) Build aForStDBGetRequestthat belong to thisForStInnerTablewith the given stateRequest.ForStDBPutRequest<K,N, List<V>> buildDBPutRequest(org.apache.flink.runtime.asyncprocessing.StateRequest<?, ?, ?, ?> stateRequest) Build aForStDBPutRequestthat belong toForStInnerTablewith the given stateRequest.deserializeValue(byte[] valueBytes) Deserialize the given bytes value to POJO value.org.forstdb.ColumnFamilyHandleGet the columnFamily handle corresponding to table.voidmergeNamespaces(N target, Collection<N> sources) byte[]serializeKey(ContextKey<K, N> contextKey) Serialize the given key to bytes.byte[]serializeValue(List<V> valueList) Serialize the given value to the outputView.Methods inherited from class org.apache.flink.runtime.state.v2.AbstractListState
add, addAll, asyncAdd, asyncAddAll, asyncGet, asyncUpdate, get, updateMethods 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.api.common.state.v2.AppendingState
add, asyncAdd, asyncGet, getMethods inherited from interface org.apache.flink.runtime.state.v2.internal.InternalPartitionedState
setCurrentNamespaceMethods inherited from interface org.apache.flink.api.common.state.v2.ListState
addAll, asyncAddAll, asyncUpdate, updateMethods inherited from interface org.apache.flink.api.common.state.v2.State
asyncClear, clear
-
Constructor Details
-
ForStListState
public ForStListState(org.apache.flink.runtime.asyncprocessing.StateRequestHandler stateRequestHandler, org.forstdb.ColumnFamilyHandle columnFamily, org.apache.flink.api.common.state.v2.ListStateDescriptor<V> listStateDescriptor, 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> valueDeserializerViewInitializer)
-
-
Method Details
-
getColumnFamilyHandle
public org.forstdb.ColumnFamilyHandle getColumnFamilyHandle()Description copied from interface:ForStInnerTableGet the columnFamily handle corresponding to table.- Specified by:
getColumnFamilyHandlein interfaceForStInnerTable<K,N, V>
-
serializeKey
Description copied from interface:ForStInnerTableSerialize the given key to bytes.- Specified by:
serializeKeyin interfaceForStInnerTable<K,N, 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
Description copied from interface:ForStInnerTableSerialize the given value to the outputView.- Specified by:
serializeValuein interfaceForStInnerTable<K,N, V> - Parameters:
valueList- 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, 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<K,N, buildDBGetRequestList<V>, ?> (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, V> - Parameters:
stateRequest- The given stateRequest.- Returns:
- The corresponding ForSt GetRequest.
-
buildDBPutRequest
public ForStDBPutRequest<K,N, buildDBPutRequestList<V>> (org.apache.flink.runtime.asyncprocessing.StateRequest<?, ?, ?, ?> stateRequest) Description copied from interface:ForStInnerTableBuild aForStDBPutRequestthat belong toForStInnerTablewith the given stateRequest.- Specified by:
buildDBPutRequestin interfaceForStInnerTable<K,N, V> - Parameters:
stateRequest- The given stateRequest.- Returns:
- The corresponding ForSt PutRequest.
-
asyncMergeNamespaces
public org.apache.flink.api.common.state.v2.StateFuture<Void> asyncMergeNamespaces(N target, Collection<N> sources) -
mergeNamespaces
-