public void setZooKeeperServer(ZooKeeperServer zks) { if (cnxnFactory != null) { cnxnFactory.setZooKeeperServer(zks); } if (secureCnxnFactory != null) { secureCnxnFactory.setZooKeeperServer(zks); } }
@Override public synchronized void startup() { // check to avoid startup follows shutdown if (shutdown) { LOG.warn("Not starting Read-only server as startup follows shutdown!"); return; } registerJMX(new ReadOnlyBean(this), self.jmxLocalPeerBean); super.startup(); self.cnxnFactory.setZooKeeperServer(this); LOG.info("Read-only server started"); }
/** * Shutdown the Peer */ public void shutdown() { // set the zookeeper server to null self.cnxnFactory.setZooKeeperServer(null); // clear all the connections self.cnxnFactory.closeAll(); // shutdown previous zookeeper if (zk != null) { zk.shutdown(); } }
self.cnxnFactory.setZooKeeperServer(null); try { ss.close();
@Override public synchronized void shutdown() { if (!canShutdown()) { LOG.debug("ZooKeeper server is not running, so not proceeding to shutdown!"); return; } shutdown = true; unregisterJMX(this); // set peer's server to null self.cnxnFactory.setZooKeeperServer(null); // clear all the connections self.cnxnFactory.closeAll(); // shutdown the server itself super.shutdown(); }
self.setCurrentEpoch(newEpoch); self.cnxnFactory.setZooKeeperServer(zk); break outerLoop; case Leader.NEWLEADER: // Getting NEWLEADER here instead of in discovery
self.cnxnFactory.setZooKeeperServer(zk);