protected org.apache.hw_v4_1_0.bookkeeper.proto.BookieServer startBookie( org.apache.hw_v4_1_0.bookkeeper.conf.ServerConfiguration conf) throws Exception { org.apache.hw_v4_1_0.bookkeeper.proto.BookieServer server = new org.apache.hw_v4_1_0.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; }