Package org.apache.zookeeper.server
Class NettyServerCnxnFactory
- java.lang.Object
-
- org.apache.zookeeper.server.ServerCnxnFactory
-
- org.apache.zookeeper.server.NettyServerCnxnFactory
-
public class NettyServerCnxnFactory extends ServerCnxnFactory
-
-
Field Summary
-
Fields inherited from class org.apache.zookeeper.server.ServerCnxnFactory
cnxns, login, saslServerCallbackHandler, secure, zkServer, ZOOKEEPER_SERVER_CNXN_FACTORY
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeAll()
boolean
closeSession(long sessionId)
void
configure(java.net.InetSocketAddress addr, int maxClientCnxns, boolean secure)
java.lang.Iterable<java.util.Map<java.lang.String,java.lang.Object>>
getAllConnectionInfo(boolean brief)
java.lang.Iterable<ServerCnxn>
getConnections()
java.net.InetSocketAddress
getLocalAddress()
int
getLocalPort()
int
getMaxClientCnxnsPerHost()
Maximum number of connections allowed from particular host (ip)void
join()
void
reconfigure(java.net.InetSocketAddress addr)
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)
-
Methods inherited from class org.apache.zookeeper.server.ServerCnxnFactory
configure, configureSaslLogin, createFactory, createFactory, createFactory, getNumAliveConnections, getZooKeeperServer, isSecure, registerConnection, setZooKeeperServer, startup, unregisterConnection
-
-
-
-
Method Detail
-
closeAll
public void closeAll()
- Specified by:
closeAll
in classServerCnxnFactory
-
closeSession
public boolean closeSession(long sessionId)
- Specified by:
closeSession
in classServerCnxnFactory
- Returns:
- true if the cnxn that contains the sessionId exists in this ServerCnxnFactory and it's closed. Otherwise false.
-
configure
public void configure(java.net.InetSocketAddress addr, int maxClientCnxns, boolean secure) throws java.io.IOException
- Specified by:
configure
in classServerCnxnFactory
- Throws:
java.io.IOException
-
getMaxClientCnxnsPerHost
public int getMaxClientCnxnsPerHost()
Maximum number of connections allowed from particular host (ip)- Specified by:
getMaxClientCnxnsPerHost
in classServerCnxnFactory
-
setMaxClientCnxnsPerHost
public void setMaxClientCnxnsPerHost(int max)
Maximum number of connections allowed from particular host (ip)- Specified by:
setMaxClientCnxnsPerHost
in classServerCnxnFactory
-
getLocalPort
public int getLocalPort()
- Specified by:
getLocalPort
in classServerCnxnFactory
-
join
public void join() throws java.lang.InterruptedException
- Specified by:
join
in classServerCnxnFactory
- Throws:
java.lang.InterruptedException
-
shutdown
public void shutdown()
- Specified by:
shutdown
in classServerCnxnFactory
-
start
public void start()
- Specified by:
start
in classServerCnxnFactory
-
reconfigure
public void reconfigure(java.net.InetSocketAddress addr)
- Specified by:
reconfigure
in classServerCnxnFactory
-
startup
public void startup(ZooKeeperServer zks, boolean startServer) throws java.io.IOException, java.lang.InterruptedException
- Specified by:
startup
in classServerCnxnFactory
- Throws:
java.io.IOException
java.lang.InterruptedException
-
getConnections
public java.lang.Iterable<ServerCnxn> getConnections()
- Specified by:
getConnections
in classServerCnxnFactory
-
getLocalAddress
public java.net.InetSocketAddress getLocalAddress()
- Specified by:
getLocalAddress
in classServerCnxnFactory
-
resetAllConnectionStats
public void resetAllConnectionStats()
- Specified by:
resetAllConnectionStats
in classServerCnxnFactory
-
getAllConnectionInfo
public java.lang.Iterable<java.util.Map<java.lang.String,java.lang.Object>> getAllConnectionInfo(boolean brief)
- Specified by:
getAllConnectionInfo
in classServerCnxnFactory
-
-