本文整理了Java中org.apache.hadoop.hbase.zookeeper.ZKUtil.getNumberOfChildren()
方法的一些代码示例,展示了ZKUtil.getNumberOfChildren()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKUtil.getNumberOfChildren()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.zookeeper.ZKUtil
类名称:ZKUtil
方法名:getNumberOfChildren
[英]Get the number of children of the specified node. If the node does not exist or has no children, returns 0. Sets no watches at all.
[中]获取指定节点的子节点数。如果节点不存在或没有子节点,则返回0。一点也不戴手表。
代码示例来源:origin: co.cask.hbase/hbase
public int getCurrentNrHRS() throws IOException {
try {
ZooKeeperWatcher zkw = getZooKeeperWatcher();
// We go to zk rather than to master to get count of regions to avoid
// HTable having a Master dependency. See HBase-2828
return ZKUtil.getNumberOfChildren(zkw,
zkw.rsZNode);
} catch (KeeperException ke) {
throw new IOException("Unexpected ZooKeeper exception", ke);
}
}
代码示例来源:origin: harbby/presto-connectors
@Override
public int getCurrentNrHRS() throws IOException {
ZooKeeperKeepAliveConnection zkw = hci.getKeepAliveZooKeeperWatcher();
try {
// We go to zk rather than to master to get count of regions to avoid
// HTable having a Master dependency. See HBase-2828
return ZKUtil.getNumberOfChildren(zkw, zkw.rsZNode);
} catch (KeeperException ke) {
throw new IOException("Unexpected ZooKeeper exception", ke);
} finally {
zkw.close();
}
}
}
内容来源于网络,如有侵权,请联系作者删除!