public void stop() throws Exception { for (org.apache.bookkeeper.proto.BookieServer bs : bks) { bs.shutdown(); } bks.clear(); zkUtil.killServer(); }
protected org.apache.bookkeeper.proto.BookieServer startBookie( org.apache.bookkeeper.conf.ServerConfiguration conf) throws Exception { org.apache.bookkeeper.proto.BookieServer server = new org.apache.bookkeeper.proto.BookieServer(conf); server.start(); int port = conf.getBookiePort(); while (zkUtil .getZooKeeperClient() .exists( "/ledgers/available/" + InetAddress.getLocalHost().getHostAddress() + ":" + port, false) == null) { Thread.sleep(500); } return server; }