public class KvStateServer extends Object
Requests are handled by asynchronous query tasks (see
that are executed by a separate query Thread pool. This pool is shared among
all TCP connections.
The incoming pipeline looks as follows:
Socket.read() -> LengthFieldBasedFrameDecoder -> KvStateServerHandler
Received binary messages are expected to contain a frame length field. Netty's
LengthFieldBasedFrameDecoder is used to fully receive the frame before
giving it to our
Connections are established and closed by the client. The server only closes the connection on a fatal failure that cannot be recovered. A server-side connection close is considered a failure by the client.
|Constructor and Description|
|Modifier and Type||Method and Description|
Returns the address of this server.
Shuts down the server and all related thread pools.
Starts the server by binding to the configured bind address (blocking).
public KvStateServer(InetAddress bindAddress, int bindPort, int numEventLoopThreads, int numQueryThreads, KvStateRegistry kvStateRegistry, KvStateRequestStats stats)
The server needs to be started via
start() in order to bind
to the configured bind address.
bindAddress- Address to bind to
bindPort- Port to bind to. Pick random port if 0.
numEventLoopThreads- Number of event loop threads
numQueryThreads- Number of query threads
kvStateRegistry- KvStateRegistry to query for KvState instances
stats- Statistics tracker
public void start() throws InterruptedException
InterruptedException- If interrupted during the bind operation
public KvStateServerAddress getAddress()
IllegalStateException- If server has not been started yet
public void shutDown()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.