/*
registration = context.registerService(QuorumStats.Provider.class, server, null);
*/
} else {
ServerConfig serverConfig = getServerConfig(peerConfig);
ZooKeeperServer zkServer = new ZooKeeperServer();
FileTxnSnapLog ftxn = new FileTxnSnapLog(new File(serverConfig.getDataLogDir()), new File(serverConfig.getDataDir()));
zkServer.setTxnLogFactory(ftxn);
zkServer.setTickTime(serverConfig.getTickTime());
zkServer.setMinSessionTimeout(serverConfig.getMinSessionTimeout());
zkServer.setMaxSessionTimeout(serverConfig.getMaxSessionTimeout());
NIOServerCnxnFactory cnxnFactory = new NIOServerCnxnFactory() {
protected void configureSaslLogin() throws IOException {
}
};
InetSocketAddress clientPortAddress = serverConfig.getClientPortAddress();
cnxnFactory.configure(clientPortAddress, serverConfig.getMaxClientCnxns());
updateZooKeeperURL(cnxnFactory.getLocalAddress(), cnxnFactory.getLocalPort());
try {
LOGGER.debug("Starting ZooKeeper server on address %s", peerConfig.getClientPortAddress());
cnxnFactory.startup(zkServer);