BookKeeper.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:bigstreams 作者:
/**
 * Create a bookkeeper client. A zookeeper client and a client socket factory
 * will be instantiated as part of this constructor.
 * 
 * @param servers
 *          A list of one of more servers on which zookeeper is running. The
 *          client assumes that the running bookies have been registered with
 *          zookeeper under the path
 *          {@link BookieWatcher#BOOKIE_REGISTRATION_PATH}
 * @throws IOException
 * @throws InterruptedException
 * @throws KeeperException
 */
public BookKeeper(String servers) throws IOException, InterruptedException,
    KeeperException {
  this(new ZooKeeper(servers, 10000, new Watcher() {
    @Override
    public void process(WatchedEvent event) {
      // TODO: handle session disconnects and expires
      if (LOG.isDebugEnabled()) {
        LOG.debug("Process: " + event.getType() + " " + event.getPath());
      }
    }
  }), new NioClientSocketChannelFactory(Executors.newCachedThreadPool(),
      Executors.newCachedThreadPool()));

  ownZKHandle = true;
  ownChannelFactory = true;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号