public class NIOServerCnxnFactory extends ServerCnxnFactory
| Modifier and Type | Field and Description |
|---|---|
protected int |
maxClientCnxns |
protected WorkerService |
workerPool |
static String |
ZOOKEEPER_NIO_DIRECT_BUFFER_BYTES
Default: 64kB
|
static String |
ZOOKEEPER_NIO_NUM_SELECTOR_THREADS
With 500 connections to an observer with watchers firing on each, is
unable to exceed 1GigE rates with only 1 selector.
|
static String |
ZOOKEEPER_NIO_NUM_WORKER_THREADS
Default: 2 * numCores
|
static String |
ZOOKEEPER_NIO_SESSIONLESS_CNXN_TIMEOUT
Default sessionless connection timeout in ms: 10000 (10s)
|
static String |
ZOOKEEPER_NIO_SHUTDOWN_TIMEOUT
Default worker pool shutdown timeout in ms: 5000 (5s)
|
cnxns, login, maxCnxns, saslServerCallbackHandler, secure, zkServer, ZOOKEEPER_MAX_CONNECTION_DEFAULT, ZOOKEEPER_SERVER_CNXN_FACTORY| Constructor and Description |
|---|
NIOServerCnxnFactory()
Construct a new server connection factory which will accept an unlimited number
of concurrent connections from each client (up to the file descriptor
limits of the operating system).
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeAll(ServerCnxn.DisconnectReason reason)
clear all the connections in the selector
|
void |
configure(InetSocketAddress addr,
int maxcc,
int backlog,
boolean secure) |
protected NIOServerCnxn |
createConnection(SocketChannel sock,
SelectionKey sk,
org.apache.zookeeper.server.NIOServerCnxnFactory.SelectorThread selectorThread) |
void |
dumpConnections(PrintWriter pwriter) |
Iterable<Map<String,Object>> |
getAllConnectionInfo(boolean brief) |
Iterable<ServerCnxn> |
getConnections() |
static ByteBuffer |
getDirectBuffer() |
InetSocketAddress |
getLocalAddress() |
int |
getLocalPort() |
int |
getMaxClientCnxnsPerHost()
Maximum number of connections allowed from particular host (ip)
|
int |
getSocketListenBacklog()
The maximum queue length of the ZooKeeper server's socket
|
void |
join() |
void |
reconfigure(InetSocketAddress addr) |
boolean |
removeCnxn(NIOServerCnxn cnxn)
De-registers the connection from the various mappings maintained
by the factory.
|
void |
resetAllConnectionStats() |
void |
setMaxClientCnxnsPerHost(int max)
Maximum number of connections allowed from particular host (ip)
|
void |
shutdown() |
void |
start() |
void |
startup(ZooKeeperServer zks,
boolean startServer) |
void |
stop() |
void |
touchCnxn(NIOServerCnxn cnxn)
Add or update cnxn in our cnxnExpiryQueue
|
addSession, closeSession, configure, configure, configureSaslLogin, createFactory, createFactory, createFactory, createFactory, createFactory, getMaxCnxns, getNumAliveConnections, getUserName, getZooKeeperServer, initMaxCnxns, isSecure, limitTotalNumberOfCnxns, registerConnection, removeCnxnFromSessionMap, setZooKeeperServer, startup, unregisterConnectionpublic static final String ZOOKEEPER_NIO_SESSIONLESS_CNXN_TIMEOUT
public static final String ZOOKEEPER_NIO_NUM_SELECTOR_THREADS
public static final String ZOOKEEPER_NIO_NUM_WORKER_THREADS
public static final String ZOOKEEPER_NIO_DIRECT_BUFFER_BYTES
public static final String ZOOKEEPER_NIO_SHUTDOWN_TIMEOUT
protected int maxClientCnxns
protected WorkerService workerPool
public NIOServerCnxnFactory()
public static ByteBuffer getDirectBuffer()
public void configure(InetSocketAddress addr, int maxcc, int backlog, boolean secure) throws IOException
configure in class ServerCnxnFactoryIOExceptionpublic void reconfigure(InetSocketAddress addr)
reconfigure in class ServerCnxnFactorypublic int getMaxClientCnxnsPerHost()
getMaxClientCnxnsPerHost in class ServerCnxnFactorypublic void setMaxClientCnxnsPerHost(int max)
setMaxClientCnxnsPerHost in class ServerCnxnFactorypublic int getSocketListenBacklog()
getSocketListenBacklog in class ServerCnxnFactorypublic void start()
start in class ServerCnxnFactorypublic void startup(ZooKeeperServer zks, boolean startServer) throws IOException, InterruptedException
startup in class ServerCnxnFactoryIOExceptionInterruptedExceptionpublic InetSocketAddress getLocalAddress()
getLocalAddress in class ServerCnxnFactorypublic int getLocalPort()
getLocalPort in class ServerCnxnFactorypublic boolean removeCnxn(NIOServerCnxn cnxn)
public void touchCnxn(NIOServerCnxn cnxn)
cnxn - protected NIOServerCnxn createConnection(SocketChannel sock, SelectionKey sk, org.apache.zookeeper.server.NIOServerCnxnFactory.SelectorThread selectorThread) throws IOException
IOExceptionpublic void closeAll(ServerCnxn.DisconnectReason reason)
closeAll in class ServerCnxnFactorypublic void stop()
public void shutdown()
shutdown in class ServerCnxnFactorypublic void join()
throws InterruptedException
join in class ServerCnxnFactoryInterruptedExceptionpublic Iterable<ServerCnxn> getConnections()
getConnections in class ServerCnxnFactorypublic void dumpConnections(PrintWriter pwriter)
public void resetAllConnectionStats()
resetAllConnectionStats in class ServerCnxnFactorypublic Iterable<Map<String,Object>> getAllConnectionInfo(boolean brief)
getAllConnectionInfo in class ServerCnxnFactoryCopyright © 2008–2021 The Apache Software Foundation. All rights reserved.