gpt4 book ai didi

org.apache.hadoop.hbase.zookeeper.ZKUtil.getNumberOfChildren()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 23:42:40 28 4
gpt4 key购买 nike

本文整理了Java中org.apache.hadoop.hbase.zookeeper.ZKUtil.getNumberOfChildren()方法的一些代码示例,展示了ZKUtil.getNumberOfChildren()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKUtil.getNumberOfChildren()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.zookeeper.ZKUtil
类名称:ZKUtil
方法名:getNumberOfChildren

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();
  }
 }
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com