Class KvStateServerImpl
- java.lang.Object
-
- org.apache.flink.queryablestate.network.AbstractServerBase<KvStateInternalRequest,KvStateResponse>
-
- org.apache.flink.queryablestate.server.KvStateServerImpl
-
- All Implemented Interfaces:
KvStateServer
@Internal public class KvStateServerImpl extends AbstractServerBase<KvStateInternalRequest,KvStateResponse> implements KvStateServer
The default implementation of theKvStateServer
.
-
-
Field Summary
-
Fields inherited from class org.apache.flink.queryablestate.network.AbstractServerBase
log
-
-
Constructor Summary
Constructors Constructor Description KvStateServerImpl(String bindAddress, Iterator<Integer> bindPortIterator, Integer numEventLoopThreads, Integer numQueryThreads, KvStateRegistry kvStateRegistry, KvStateRequestStats stats)
Creates the state server.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageSerializer<KvStateInternalRequest,KvStateResponse>
getSerializer()
InetSocketAddress
getServerAddress()
Returns the address of this server.AbstractServerHandler<KvStateInternalRequest,KvStateResponse>
initializeHandler()
Returns thehandler
to be used for serving the incoming requests.void
shutdown()
Shuts down the server and all related thread pools.void
start()
Starts the server by binding to the configured bind address (blocking).-
Methods inherited from class org.apache.flink.queryablestate.network.AbstractServerBase
getQueryExecutor, getServerName, isEventGroupShutdown, shutdownServer
-
-
-
-
Constructor Detail
-
KvStateServerImpl
public KvStateServerImpl(String bindAddress, Iterator<Integer> bindPortIterator, Integer numEventLoopThreads, Integer numQueryThreads, KvStateRegistry kvStateRegistry, 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 AbstractServerHandler<KvStateInternalRequest,KvStateResponse> initializeHandler()
Description copied from class:AbstractServerBase
Returns thehandler
to be used for serving the incoming requests.- Specified by:
initializeHandler
in classAbstractServerBase<KvStateInternalRequest,KvStateResponse>
-
getSerializer
public MessageSerializer<KvStateInternalRequest,KvStateResponse> getSerializer()
-
start
public void start() throws Throwable
Description copied from class:AbstractServerBase
Starts the server by binding to the configured bind address (blocking).- Specified by:
start
in interfaceKvStateServer
- Overrides:
start
in classAbstractServerBase<KvStateInternalRequest,KvStateResponse>
- Throws:
Throwable
-
getServerAddress
public InetSocketAddress getServerAddress()
Description copied from class:AbstractServerBase
Returns the address of this server.- Specified by:
getServerAddress
in interfaceKvStateServer
- Overrides:
getServerAddress
in classAbstractServerBase<KvStateInternalRequest,KvStateResponse>
- Returns:
- AbstractServerBase address
-
shutdown
public void shutdown()
Description copied from interface:KvStateServer
Shuts down the server and all related thread pools.- Specified by:
shutdown
in interfaceKvStateServer
-
-