Пример #1
0
    public void stop() throws Exception {
      for (org.apache.hw_v4_2_0.bookkeeper.proto.BookieServer bs : bks) {
        bs.shutdown();
      }
      bks.clear();

      zkUtil.killServer();
    }
Пример #2
0
    protected org.apache.hw_v4_2_0.bookkeeper.proto.BookieServer startBookie(
        org.apache.hw_v4_2_0.bookkeeper.conf.ServerConfiguration conf) throws Exception {
      org.apache.hw_v4_2_0.bookkeeper.proto.BookieServer server =
          new org.apache.hw_v4_2_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;
    }