@Internal public class KvStateServerImpl extends AbstractServerBase<KvStateInternalRequest,KvStateResponse> implements KvStateServer
KvStateServer
.log
Constructor and Description |
---|
KvStateServerImpl(String bindAddress,
Iterator<Integer> bindPortIterator,
Integer numEventLoopThreads,
Integer numQueryThreads,
KvStateRegistry kvStateRegistry,
KvStateRequestStats stats)
Creates the state server.
|
Modifier and Type | Method and Description |
---|---|
MessageSerializer<KvStateInternalRequest,KvStateResponse> |
getSerializer() |
InetSocketAddress |
getServerAddress()
Returns the address of this server.
|
AbstractServerHandler<KvStateInternalRequest,KvStateResponse> |
initializeHandler()
Returns the
handler 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).
|
getQueryExecutor, getServerName, isEventGroupShutdown, shutdownServer
public KvStateServerImpl(String bindAddress, Iterator<Integer> bindPortIterator, Integer numEventLoopThreads, Integer numQueryThreads, KvStateRegistry kvStateRegistry, KvStateRequestStats stats)
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.
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.public AbstractServerHandler<KvStateInternalRequest,KvStateResponse> initializeHandler()
AbstractServerBase
handler
to be used for serving the incoming
requests.initializeHandler
in class AbstractServerBase<KvStateInternalRequest,KvStateResponse>
public MessageSerializer<KvStateInternalRequest,KvStateResponse> getSerializer()
public void start() throws Throwable
AbstractServerBase
start
in interface KvStateServer
start
in class AbstractServerBase<KvStateInternalRequest,KvStateResponse>
Throwable
public InetSocketAddress getServerAddress()
AbstractServerBase
getServerAddress
in interface KvStateServer
getServerAddress
in class AbstractServerBase<KvStateInternalRequest,KvStateResponse>
public void shutdown()
KvStateServer
shutdown
in interface KvStateServer
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.