Class ForStValueState<K,​N,​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>, org.apache.flink.runtime.state.v2.internal.InternalKeyedState<K,​N,​V>, org.apache.flink.runtime.state.v2.internal.InternalPartitionedState<N>, org.apache.flink.runtime.state.v2.internal.InternalValueState<K,​N,​V>, ForStInnerTable<K,​N,​V>

    public class ForStValueState<K,​N,​V>
    extends org.apache.flink.runtime.state.v2.AbstractValueState<K,​N,​V>
    implements org.apache.flink.api.common.state.v2.ValueState<V>, ForStInnerTable<K,​N,​V>
    The AbstractValueState implement for ForStDB.
    • Field Summary

      • Fields inherited from class org.apache.flink.runtime.state.v2.AbstractKeyedState

        stateRequestHandler
    • Constructor Summary

      Constructors 
      Constructor Description
      ForStValueState​(org.apache.flink.runtime.asyncprocessing.StateRequestHandler stateRequestHandler, org.forstdb.ColumnFamilyHandle columnFamily, org.apache.flink.api.common.state.v2.ValueStateDescriptor<V> valueStateDescriptor, 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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ForStDBGetRequest<K,​N,​V,​V> buildDBGetRequest​(org.apache.flink.runtime.asyncprocessing.StateRequest<?,​?,​?,​?> stateRequest)
      Build a ForStDBGetRequest that belong to this ForStInnerTable with the given stateRequest.
      ForStDBPutRequest<K,​N,​V> buildDBPutRequest​(org.apache.flink.runtime.asyncprocessing.StateRequest<?,​?,​?,​?> stateRequest)
      Build a ForStDBPutRequest that belong to ForStInnerTable with the given stateRequest.
      V deserializeValue​(byte[] valueBytes)
      Deserialize the given bytes value to POJO value.
      org.forstdb.ColumnFamilyHandle getColumnFamilyHandle()
      Get the columnFamily handle corresponding to table.
      byte[] serializeKey​(ContextKey<K,​N> 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.AbstractValueState

        asyncUpdate, asyncValue, update, value
      • Methods inherited from class org.apache.flink.runtime.state.v2.AbstractKeyedState

        asyncClear, clear, getStateDescriptor, getStateRequestHandler, getValueSerializer, handleRequest, handleRequestSync, setCurrentNamespace
      • Methods inherited from interface org.apache.flink.runtime.state.v2.internal.InternalPartitionedState

        setCurrentNamespace
      • Methods inherited from interface org.apache.flink.api.common.state.v2.State

        asyncClear, clear
      • Methods inherited from interface org.apache.flink.api.common.state.v2.ValueState

        asyncUpdate, asyncValue, update, value
    • Constructor Detail

      • ForStValueState

        public ForStValueState​(org.apache.flink.runtime.asyncprocessing.StateRequestHandler stateRequestHandler,
                               org.forstdb.ColumnFamilyHandle columnFamily,
                               org.apache.flink.api.common.state.v2.ValueStateDescriptor<V> valueStateDescriptor,
                               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 Detail

      • getColumnFamilyHandle

        public org.forstdb.ColumnFamilyHandle getColumnFamilyHandle()
        Description copied from interface: ForStInnerTable
        Get the columnFamily handle corresponding to table.
        Specified by:
        getColumnFamilyHandle in interface ForStInnerTable<K,​N,​V>
      • serializeKey

        public byte[] serializeKey​(ContextKey<K,​N> contextKey)
                            throws IOException
        Description copied from interface: ForStInnerTable
        Serialize the given key to bytes.
        Specified by:
        serializeKey in interface ForStInnerTable<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

        public byte[] serializeValue​(V value)
                              throws IOException
        Description copied from interface: ForStInnerTable
        Serialize the given value to the outputView.
        Specified by:
        serializeValue in interface ForStInnerTable<K,​N,​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: ForStInnerTable
        Deserialize the given bytes value to POJO value.
        Specified by:
        deserializeValue in interface ForStInnerTable<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,​V,​V> buildDBGetRequest​(org.apache.flink.runtime.asyncprocessing.StateRequest<?,​?,​?,​?> stateRequest)
        Description copied from interface: ForStInnerTable
        Build a ForStDBGetRequest that belong to this ForStInnerTable with the given stateRequest.
        Specified by:
        buildDBGetRequest in interface ForStInnerTable<K,​N,​V>
        Parameters:
        stateRequest - The given stateRequest.
        Returns:
        The corresponding ForSt GetRequest.
      • buildDBPutRequest

        public ForStDBPutRequest<K,​N,​V> buildDBPutRequest​(org.apache.flink.runtime.asyncprocessing.StateRequest<?,​?,​?,​?> stateRequest)
        Description copied from interface: ForStInnerTable
        Build a ForStDBPutRequest that belong to ForStInnerTable with the given stateRequest.
        Specified by:
        buildDBPutRequest in interface ForStInnerTable<K,​N,​V>
        Parameters:
        stateRequest - The given stateRequest.
        Returns:
        The corresponding ForSt PutRequest.