public class NIOServerCnxnFactory extends ServerCnxnFactory implements Runnable
ServerCnxnFactory.PacketProcessor
cnxns, login, saslServerCallbackHandler, zkServer, 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). startup(zks) must be called subsequently.
|
Modifier and Type | Method and Description |
---|---|
void |
closeAll()
clear all the connections in the selector
|
void |
closeSession(long sessionId) |
void |
configure(InetSocketAddress addr,
int maxcc) |
protected NIOServerCnxn |
createConnection(SocketChannel sock,
SelectionKey sk) |
Iterable<ServerCnxn> |
getConnections() |
InetSocketAddress |
getLocalAddress() |
int |
getLocalPort() |
int |
getMaxClientCnxnsPerHost()
Maximum number of connections allowed from particular host (ip)
|
void |
join() |
void |
run() |
void |
setMaxClientCnxnsPerHost(int max)
Maximum number of connections allowed from particular host (ip)
|
void |
shutdown() |
void |
start() |
void |
startup(ZooKeeperServer zks) |
configureSaslLogin, createFactory, createFactory, createFactory, getNumAliveConnections, registerConnection, setZooKeeperServer, unregisterConnection
public NIOServerCnxnFactory() throws IOException
IOException
public void configure(InetSocketAddress addr, int maxcc) throws IOException
configure
in class ServerCnxnFactory
IOException
public int getMaxClientCnxnsPerHost()
getMaxClientCnxnsPerHost
in class ServerCnxnFactory
public void setMaxClientCnxnsPerHost(int max)
setMaxClientCnxnsPerHost
in class ServerCnxnFactory
public void start()
start
in class ServerCnxnFactory
public void startup(ZooKeeperServer zks) throws IOException, InterruptedException
startup
in class ServerCnxnFactory
IOException
InterruptedException
public InetSocketAddress getLocalAddress()
getLocalAddress
in class ServerCnxnFactory
public int getLocalPort()
getLocalPort
in class ServerCnxnFactory
protected NIOServerCnxn createConnection(SocketChannel sock, SelectionKey sk) throws IOException
IOException
public void closeAll()
closeAll
in class ServerCnxnFactory
public void shutdown()
shutdown
in class ServerCnxnFactory
public void closeSession(long sessionId)
closeSession
in class ServerCnxnFactory
public void join() throws InterruptedException
join
in class ServerCnxnFactory
InterruptedException
public Iterable<ServerCnxn> getConnections()
getConnections
in class ServerCnxnFactory
Copyright © 2017 The Apache Software Foundation