_zookeeperServerMain = new PublicZooKeeperServerMain(); LOGGER.info("Zookeeper data path - " + dataDirPath); _zkDataDir = dataDirPath;
@Override public void run() { try { _zookeeperServerMain.initializeAndRun(args); } catch (QuorumPeerConfig.ConfigException e) { LOGGER.warn("Caught exception while starting ZK", e); } catch (IOException e) { LOGGER.warn("Caught exception while starting ZK", e); } } }.start();
/** * Stops a local Zk instance. * @param deleteDataDir Whether or not to delete the data directory */ public synchronized static void stopLocalZkServer(final boolean deleteDataDir) { if (_zookeeperServerMain != null) { try { // Shut down ZK _zookeeperServerMain.shutdown(); _zookeeperServerMain = null; // Delete the data dir if (deleteDataDir) { org.apache.commons.io.FileUtils.deleteDirectory(new File(_zkDataDir)); } } catch (Exception e) { LOGGER.warn("Caught exception while stopping ZK server", e); throw new RuntimeException(e); } } } }
_zookeeperServerMain = new PublicZooKeeperServerMain(); LOGGER.info("Zookeeper data path - " + dataDirPath); _zkDataDir = dataDirPath;
/** * Stops a local Zk instance. * * @param deleteDataDir Whether or not to delete the data directory */ public synchronized static void stopLocalZkServer(final boolean deleteDataDir) { if (_zookeeperServerMain != null) { try { // Shut down ZK _zookeeperServerMain.shutdown(); _zookeeperServerMain = null; // Delete the data dir if (deleteDataDir) { org.apache.commons.io.FileUtils.deleteDirectory(new File(_zkDataDir)); } } catch (Exception e) { LOGGER.warn("Caught exception while stopping ZK server", e); throw new RuntimeException(e); } } } }
@Override public void run() { try { _zookeeperServerMain.initializeAndRun(args); } catch (QuorumPeerConfig.ConfigException e) { LOGGER.warn("Caught exception while starting ZK", e); } catch (IOException e) { LOGGER.warn("Caught exception while starting ZK", e); } } }.start();