public abstract class ServerCnxnFactory extends Object
Modifier and Type | Field and Description |
---|---|
protected Set<ServerCnxn> |
cnxns |
Login |
login |
protected int |
maxCnxns |
protected SaslServerCallbackHandler |
saslServerCallbackHandler |
protected boolean |
secure |
protected ZooKeeperServer |
zkServer |
static int |
ZOOKEEPER_MAX_CONNECTION_DEFAULT |
static String |
ZOOKEEPER_SERVER_CNXN_FACTORY |
Constructor and Description |
---|
ServerCnxnFactory() |
Modifier and Type | Method and Description |
---|---|
void |
addSession(long sessionId,
ServerCnxn cnxn) |
abstract void |
closeAll(ServerCnxn.DisconnectReason reason) |
boolean |
closeSession(long sessionId,
ServerCnxn.DisconnectReason reason) |
void |
configure(InetSocketAddress addr,
int maxcc) |
void |
configure(InetSocketAddress addr,
int maxcc,
int backlog) |
abstract void |
configure(InetSocketAddress addr,
int maxcc,
int backlog,
boolean secure) |
protected void |
configureSaslLogin()
Initialize the server SASL if specified.
|
static ServerCnxnFactory |
createFactory() |
static ServerCnxnFactory |
createFactory(InetSocketAddress addr,
int maxClientCnxns) |
static ServerCnxnFactory |
createFactory(InetSocketAddress addr,
int maxClientCnxns,
int backlog) |
static ServerCnxnFactory |
createFactory(int clientPort,
int maxClientCnxns) |
static ServerCnxnFactory |
createFactory(int clientPort,
int maxClientCnxns,
int backlog) |
abstract Iterable<Map<String,Object>> |
getAllConnectionInfo(boolean brief) |
abstract Iterable<ServerCnxn> |
getConnections() |
abstract InetSocketAddress |
getLocalAddress() |
abstract int |
getLocalPort() |
abstract int |
getMaxClientCnxnsPerHost()
Maximum number of connections allowed from particular host (ip)
|
int |
getMaxCnxns()
Maximum number of connections allowed in the ZooKeeper system
|
int |
getNumAliveConnections() |
abstract int |
getSocketListenBacklog()
The maximum queue length of the ZooKeeper server's socket
|
static String |
getUserName()
User who has started the ZooKeeper server user, it will be the logged-in
user.
|
ZooKeeperServer |
getZooKeeperServer() |
protected void |
initMaxCnxns() |
boolean |
isSecure() |
abstract void |
join() |
protected boolean |
limitTotalNumberOfCnxns()
Ensure total number of connections are less than the maxCnxns
|
abstract void |
reconfigure(InetSocketAddress addr) |
void |
registerConnection(ServerCnxn serverCnxn) |
void |
removeCnxnFromSessionMap(ServerCnxn cnxn) |
abstract void |
resetAllConnectionStats() |
abstract void |
setMaxClientCnxnsPerHost(int max)
Maximum number of connections allowed from particular host (ip)
|
void |
setZooKeeperServer(ZooKeeperServer zks) |
abstract void |
shutdown() |
abstract void |
start() |
void |
startup(ZooKeeperServer zkServer) |
abstract void |
startup(ZooKeeperServer zkServer,
boolean startServer) |
void |
unregisterConnection(ServerCnxn serverCnxn) |
public static final String ZOOKEEPER_SERVER_CNXN_FACTORY
public static final int ZOOKEEPER_MAX_CONNECTION_DEFAULT
protected boolean secure
protected int maxCnxns
protected SaslServerCallbackHandler saslServerCallbackHandler
public Login login
protected ZooKeeperServer zkServer
protected final Set<ServerCnxn> cnxns
public void addSession(long sessionId, ServerCnxn cnxn)
public void removeCnxnFromSessionMap(ServerCnxn cnxn)
public boolean closeSession(long sessionId, ServerCnxn.DisconnectReason reason)
public abstract int getLocalPort()
public abstract Iterable<ServerCnxn> getConnections()
public int getNumAliveConnections()
public final ZooKeeperServer getZooKeeperServer()
public void configure(InetSocketAddress addr, int maxcc) throws IOException
IOException
public void configure(InetSocketAddress addr, int maxcc, int backlog) throws IOException
IOException
public abstract void configure(InetSocketAddress addr, int maxcc, int backlog, boolean secure) throws IOException
IOException
public abstract void reconfigure(InetSocketAddress addr)
public abstract int getMaxClientCnxnsPerHost()
public abstract void setMaxClientCnxnsPerHost(int max)
public boolean isSecure()
public void startup(ZooKeeperServer zkServer) throws IOException, InterruptedException
IOException
InterruptedException
public abstract void startup(ZooKeeperServer zkServer, boolean startServer) throws IOException, InterruptedException
IOException
InterruptedException
public abstract int getSocketListenBacklog()
public abstract void join() throws InterruptedException
InterruptedException
public abstract void shutdown()
public abstract void start()
public final void setZooKeeperServer(ZooKeeperServer zks)
public abstract void closeAll(ServerCnxn.DisconnectReason reason)
public static ServerCnxnFactory createFactory() throws IOException
IOException
public static ServerCnxnFactory createFactory(int clientPort, int maxClientCnxns) throws IOException
IOException
public static ServerCnxnFactory createFactory(int clientPort, int maxClientCnxns, int backlog) throws IOException
IOException
public static ServerCnxnFactory createFactory(InetSocketAddress addr, int maxClientCnxns) throws IOException
IOException
public static ServerCnxnFactory createFactory(InetSocketAddress addr, int maxClientCnxns, int backlog) throws IOException
IOException
public abstract InetSocketAddress getLocalAddress()
public abstract void resetAllConnectionStats()
public abstract Iterable<Map<String,Object>> getAllConnectionInfo(boolean brief)
public void unregisterConnection(ServerCnxn serverCnxn)
public void registerConnection(ServerCnxn serverCnxn)
protected void configureSaslLogin() throws IOException
IOException
- if jaas.conf is missing or there's an error in it.public static String getUserName()
public int getMaxCnxns()
protected void initMaxCnxns()
protected boolean limitTotalNumberOfCnxns()
Copyright © 2008–2022 The Apache Software Foundation. All rights reserved.