Class KvStateServerImpl

  • All Implemented Interfaces:
    org.apache.flink.runtime.query.KvStateServer

    @Internal
    public class KvStateServerImpl
    extends org.apache.flink.queryablestate.network.AbstractServerBase<KvStateInternalRequest,​org.apache.flink.queryablestate.messages.KvStateResponse>
    implements org.apache.flink.runtime.query.KvStateServer
    The default implementation of the KvStateServer.
    • Constructor Detail

      • KvStateServerImpl

        public KvStateServerImpl​(String bindAddress,
                                 Iterator<Integer> bindPortIterator,
                                 Integer numEventLoopThreads,
                                 Integer numQueryThreads,
                                 org.apache.flink.runtime.query.KvStateRegistry kvStateRegistry,
                                 org.apache.flink.queryablestate.network.stats.KvStateRequestStats stats)
        Creates the state server.

        The server is instantiated using reflection by the QueryableStateUtils.createKvStateServer(InetAddress, Iterator, int, int, KvStateRegistry, KvStateRequestStats).

        The server needs to be started via start() in order to bind to the configured bind address.

        Parameters:
        bindAddress - the address to listen to.
        bindPortIterator - the port range to try to bind to.
        numEventLoopThreads - number of event loop threads.
        numQueryThreads - number of query threads.
        kvStateRegistry - KvStateRegistry to query for state instances.
        stats - the statistics collector.
    • Method Detail

      • initializeHandler

        public org.apache.flink.queryablestate.network.AbstractServerHandler<KvStateInternalRequest,​org.apache.flink.queryablestate.messages.KvStateResponse> initializeHandler()
        Specified by:
        initializeHandler in class org.apache.flink.queryablestate.network.AbstractServerBase<KvStateInternalRequest,​org.apache.flink.queryablestate.messages.KvStateResponse>
      • getSerializer

        public org.apache.flink.queryablestate.network.messages.MessageSerializer<KvStateInternalRequest,​org.apache.flink.queryablestate.messages.KvStateResponse> getSerializer()
      • start

        public void start()
                   throws Throwable
        Specified by:
        start in interface org.apache.flink.runtime.query.KvStateServer
        Overrides:
        start in class org.apache.flink.queryablestate.network.AbstractServerBase<KvStateInternalRequest,​org.apache.flink.queryablestate.messages.KvStateResponse>
        Throws:
        Throwable
      • getServerAddress

        public InetSocketAddress getServerAddress()
        Specified by:
        getServerAddress in interface org.apache.flink.runtime.query.KvStateServer
        Overrides:
        getServerAddress in class org.apache.flink.queryablestate.network.AbstractServerBase<KvStateInternalRequest,​org.apache.flink.queryablestate.messages.KvStateResponse>
      • shutdown

        public void shutdown()
        Specified by:
        shutdown in interface org.apache.flink.runtime.query.KvStateServer