Java 类org.apache.hadoop.hbase.zookeeper.EmptyWatcher 实例源码

项目:hbase    文件:Canary.java   
@Override public Void call() throws Exception {
  ZooKeeper zooKeeper = null;
  try {
    zooKeeper = new ZooKeeper(host, timeout, EmptyWatcher.instance);
    Stat exists = zooKeeper.exists(znode, false);
    StopWatch stopwatch = new StopWatch();
    stopwatch.start();
    zooKeeper.getData(znode, false, exists);
    stopwatch.stop();
    sink.publishReadTiming(znode, host, stopwatch.getTime());
  } catch (KeeperException | InterruptedException e) {
    sink.publishReadFailure(znode, host);
  } finally {
    if (zooKeeper != null) {
      zooKeeper.close();
    }
  }
  return null;
}