本文整理了Java中org.apache.hadoop.hbase.zookeeper.ZKUtil.appendRSZnodes()
方法的一些代码示例,展示了ZKUtil.appendRSZnodes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKUtil.appendRSZnodes()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.zookeeper.ZKUtil
类名称:ZKUtil
方法名:appendRSZnodes
暂无
代码示例来源:origin: apache/hbase
/**
* Appends replication znodes to the passed StringBuilder.
*
* @param zkw reference to the {@link ZKWatcher} which also contains configuration and operation
* @param sb the {@link StringBuilder} to append to
* @throws KeeperException if a ZooKeeper operation fails
*/
private static void getReplicationZnodesDump(ZKWatcher zkw, StringBuilder sb)
throws KeeperException {
String replicationZnode = zkw.getZNodePaths().replicationZNode;
if (ZKUtil.checkExists(zkw, replicationZnode) == -1) {
return;
}
// do a ls -r on this znode
sb.append("\n").append(replicationZnode).append(": ");
List<String> children = ZKUtil.listChildrenNoWatch(zkw, replicationZnode);
for (String child : children) {
String znode = ZNodePaths.joinZNode(replicationZnode, child);
if (znode.equals(zkw.getZNodePaths().peersZNode)) {
appendPeersZnodes(zkw, znode, sb);
} else if (znode.equals(zkw.getZNodePaths().queuesZNode)) {
appendRSZnodes(zkw, znode, sb);
} else if (znode.equals(zkw.getZNodePaths().hfileRefsZNode)) {
appendHFileRefsZnodes(zkw, znode, sb);
}
}
}
代码示例来源:origin: harbby/presto-connectors
/**
* Appends replication znodes to the passed StringBuilder.
* @param zkw
* @param sb
* @throws KeeperException
*/
private static void getReplicationZnodesDump(ZooKeeperWatcher zkw, StringBuilder sb)
throws KeeperException {
String replicationZNodeName = zkw.getConfiguration().get("zookeeper.znode.replication",
"replication");
String replicationZnode = joinZNode(zkw.baseZNode, replicationZNodeName);
if (ZKUtil.checkExists(zkw, replicationZnode) == -1) return;
// do a ls -r on this znode
sb.append("\n").append(replicationZnode).append(": ");
List<String> children = ZKUtil.listChildrenNoWatch(zkw, replicationZnode);
for (String child : children) {
String znode = joinZNode(replicationZnode, child);
if (child.equals(zkw.getConfiguration().get("zookeeper.znode.replication.peers", "peers"))) {
appendPeersZnodes(zkw, znode, sb);
} else if (child.equals(zkw.getConfiguration().
get("zookeeper.znode.replication.rs", "rs"))) {
appendRSZnodes(zkw, znode, sb);
}
}
}
代码示例来源:origin: org.apache.hbase/hbase-zookeeper
/**
* Appends replication znodes to the passed StringBuilder.
*
* @param zkw reference to the {@link ZKWatcher} which also contains configuration and operation
* @param sb the {@link StringBuilder} to append to
* @throws KeeperException if a ZooKeeper operation fails
*/
private static void getReplicationZnodesDump(ZKWatcher zkw, StringBuilder sb)
throws KeeperException {
String replicationZnode = zkw.getZNodePaths().replicationZNode;
if (ZKUtil.checkExists(zkw, replicationZnode) == -1) {
return;
}
// do a ls -r on this znode
sb.append("\n").append(replicationZnode).append(": ");
List<String> children = ZKUtil.listChildrenNoWatch(zkw, replicationZnode);
for (String child : children) {
String znode = ZNodePaths.joinZNode(replicationZnode, child);
if (znode.equals(zkw.getZNodePaths().peersZNode)) {
appendPeersZnodes(zkw, znode, sb);
} else if (znode.equals(zkw.getZNodePaths().queuesZNode)) {
appendRSZnodes(zkw, znode, sb);
} else if (znode.equals(zkw.getZNodePaths().hfileRefsZNode)) {
appendHFileRefsZnodes(zkw, znode, sb);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!