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

x33g5p2x  于2022-02-05 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(125)

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

ZKUtil.logZKTree介绍

[英]Recursively print the current state of ZK (non-transactional)
[中]递归打印ZK的当前状态(非事务性)

代码示例

代码示例来源:origin: apache/hbase

  1. /**
  2. * Recursively print the current state of ZK (non-transactional)
  3. * @param root name of the root directory in zk to print
  4. */
  5. public static void logZKTree(ZKWatcher zkw, String root) {
  6. if (!LOG.isDebugEnabled()) {
  7. return;
  8. }
  9. LOG.debug("Current zk system:");
  10. String prefix = "|-";
  11. LOG.debug(prefix + root);
  12. try {
  13. logZKTree(zkw, root, prefix);
  14. } catch (KeeperException e) {
  15. throw new RuntimeException(e);
  16. }
  17. }

代码示例来源:origin: apache/hbase

  1. /**
  2. * Helper method to print the current state of the ZK tree.
  3. * @see #logZKTree(ZKWatcher, String)
  4. * @throws KeeperException if an unexpected exception occurs
  5. */
  6. protected static void logZKTree(ZKWatcher zkw, String root, String prefix)
  7. throws KeeperException {
  8. List<String> children = ZKUtil.listChildrenNoWatch(zkw, root);
  9. if (children == null) {
  10. return;
  11. }
  12. for (String child : children) {
  13. LOG.debug(prefix + child);
  14. String node = ZNodePaths.joinZNode(root.equals("/") ? "" : root, child);
  15. logZKTree(zkw, node, prefix + "---");
  16. }
  17. }

代码示例来源:origin: co.cask.hbase/hbase

  1. /**
  2. * Recursively print the current state of ZK (non-transactional)
  3. * @param root name of the root directory in zk to print
  4. * @throws KeeperException
  5. */
  6. public static void logZKTree(ZooKeeperWatcher zkw, String root) {
  7. if (!LOG.isDebugEnabled()) return;
  8. LOG.debug("Current zk system:");
  9. String prefix = "|-";
  10. LOG.debug(prefix + root);
  11. try {
  12. logZKTree(zkw, root, prefix);
  13. } catch (KeeperException e) {
  14. throw new RuntimeException(e);
  15. }
  16. }

代码示例来源:origin: org.apache.hbase/hbase-zookeeper

  1. /**
  2. * Recursively print the current state of ZK (non-transactional)
  3. * @param root name of the root directory in zk to print
  4. */
  5. public static void logZKTree(ZKWatcher zkw, String root) {
  6. if (!LOG.isDebugEnabled()) {
  7. return;
  8. }
  9. LOG.debug("Current zk system:");
  10. String prefix = "|-";
  11. LOG.debug(prefix + root);
  12. try {
  13. logZKTree(zkw, root, prefix);
  14. } catch (KeeperException e) {
  15. throw new RuntimeException(e);
  16. }
  17. }

代码示例来源:origin: co.cask.hbase/hbase

  1. /**
  2. * Helper method to print the current state of the ZK tree.
  3. * @see #logZKTree(ZooKeeperWatcher, String)
  4. * @throws KeeperException if an unexpected exception occurs
  5. */
  6. protected static void logZKTree(ZooKeeperWatcher zkw, String root, String prefix) throws KeeperException {
  7. List<String> children = ZKUtil.listChildrenNoWatch(zkw, root);
  8. if (children == null) return;
  9. for (String child : children) {
  10. LOG.debug(prefix + child);
  11. String node = ZKUtil.joinZNode(root.equals("/") ? "" : root, child);
  12. logZKTree(zkw, node, prefix + "---");
  13. }
  14. }

代码示例来源:origin: org.apache.hbase/hbase-zookeeper

  1. /**
  2. * Helper method to print the current state of the ZK tree.
  3. * @see #logZKTree(ZKWatcher, String)
  4. * @throws KeeperException if an unexpected exception occurs
  5. */
  6. protected static void logZKTree(ZKWatcher zkw, String root, String prefix)
  7. throws KeeperException {
  8. List<String> children = ZKUtil.listChildrenNoWatch(zkw, root);
  9. if (children == null) {
  10. return;
  11. }
  12. for (String child : children) {
  13. LOG.debug(prefix + child);
  14. String node = ZNodePaths.joinZNode(root.equals("/") ? "" : root, child);
  15. logZKTree(zkw, node, prefix + "---");
  16. }
  17. }

代码示例来源:origin: harbby/presto-connectors

  1. /**
  2. * Helper method to print the current state of the ZK tree.
  3. * @see #logZKTree(ZooKeeperWatcher, String)
  4. * @throws KeeperException if an unexpected exception occurs
  5. */
  6. protected static void logZKTree(ZooKeeperWatcher zkw, String root, String prefix)
  7. throws KeeperException {
  8. List<String> children = ZKUtil.listChildrenNoWatch(zkw, root);
  9. if (children == null) return;
  10. for (String child : children) {
  11. LOG.debug(prefix + child);
  12. String node = ZKUtil.joinZNode(root.equals("/") ? "" : root, child);
  13. logZKTree(zkw, node, prefix + "---");
  14. }
  15. }

代码示例来源:origin: harbby/presto-connectors

  1. /**
  2. * Recursively print the current state of ZK (non-transactional)
  3. * @param root name of the root directory in zk to print
  4. */
  5. public static void logZKTree(ZooKeeperWatcher zkw, String root) {
  6. if (!LOG.isDebugEnabled()) return;
  7. LOG.debug("Current zk system:");
  8. String prefix = "|-";
  9. LOG.debug(prefix + root);
  10. try {
  11. logZKTree(zkw, root, prefix);
  12. } catch (KeeperException e) {
  13. throw new RuntimeException(e);
  14. }
  15. }

相关文章