/** * Blocks until Zookeeper terminates. * * @throws InterruptedException if the caller thread is interrupted while waiting */ private void await() throws InterruptedException { connectionFactory.join(); }
@Override public void close() throws IOException { if (started.get() && !stopped.getAndSet(true)) { cnxnFactory.shutdown(); try { cnxnFactory.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } if (zkServer.isRunning()) { zkServer.shutdown(); } deleteRecursively(zkDataDir.toPath(), ALLOW_INSECURE); } }
shutdown(); cnxnFactory.join(); if (zkServer.canShutdown()) { zkServer.shutdown(true);
/** * Blocks until Zookeeper terminates. * * @throws InterruptedException if the caller thread is interrupted while waiting */ public void await() throws InterruptedException { connectionFactory.join(); }
/** * Blocks until Zookeeper terminates. * * @throws InterruptedException if the caller thread is interrupted while waiting */ public void await() throws InterruptedException { connectionFactory.join(); }
public void join() { if (cnxnFactory != null) { try { cnxnFactory.join(); } catch (InterruptedException e) { // Note from ZookeeperServerMain: warn, but generally this is ok LOG.warn("Server join interrupted", e); } } }
@Override public void run() { try { cnxnFactory.join(); if (zkServer.isRunning()) { zkServer.shutdown(); } } catch (InterruptedException e) { LOG.error(e.getMessage(), e); } } });
public void run() { try { cnxnFactory.join(); if (zkServer.isRunning()) { zkServer.shutdown(); } } catch (InterruptedException e) { if (zkServer.isRunning()) { zkServer.shutdown(); } } } };
public void teardown() { serverCnxnFactory.shutdown(); try { serverCnxnFactory.join(); } catch (InterruptedException e) { LOGGER.warn("Zookeeper server may not have terminated cleanly!", e); } try { FileUtil.deleteDir(snapshotDir); FileUtil.deleteDir(logDir); } catch (FileNotFoundException | NullPointerException e) { LOGGER.warn("Zookeeper Server Environment Cleanup failed!", e); } }
/** * Shutdown the serving instance * @throws IOException If there is a low-level I/O error. */ protected void shutdown() throws IOException { zooKeeperServer.shutdown(); ZKDatabase zkDb = zooKeeperServer.getZKDatabase(); if (cnxnFactory != null && cnxnFactory.getLocalPort() != 0) { waitForServerDown(getZkHost() + ":" + getPort(), 5000); } if (cnxnFactory != null) { cnxnFactory.shutdown(); try { cnxnFactory.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } if (zkDb != null) { zkDb.close(); } }
@Override public void close() throws IOException { if (started.get() && !stopped.getAndSet(true)) { cnxnFactory.shutdown(); try { cnxnFactory.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } if (zkServer.isRunning()) { zkServer.shutdown(); } deleteRecursively(zkDataDir.toPath(), ALLOW_INSECURE); } }
config.getMaxClientCnxns()); cnxnFactory.startup(zooKeeperServer); cnxnFactory.join();
config.getMaxClientCnxns()); cnxnFactory.startup(zkServer); cnxnFactory.join(); if (zkServer.isRunning()) { zkServer.shutdown();