gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-17 02:39:31 26 4
gpt4 key购买 nike

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

ZKProcedureUtil.logZKTree介绍

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

代码示例

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

public void clearChildZNodes() throws KeeperException {
 LOG.debug("Clearing all znodes {}, {}, {}", acquiredZnode, reachedZnode, abortZnode);
 // If the coordinator was shutdown mid-procedure, then we are going to lose
 // an procedure that was previously started by cleaning out all the previous state. Its much
 // harder to figure out how to keep an procedure going and the subject of HBASE-5487.
 ZKUtil.deleteChildrenRecursivelyMultiOrSequential(watcher, true, acquiredZnode, reachedZnode,
  abortZnode);
 if (LOG.isTraceEnabled()) {
  logZKTree(this.baseZNode);
 }
}

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

/**
 * Recursively print the current state of ZK (non-transactional)
 * @param root name of the root directory in zk to print
 * @throws KeeperException
 */
void logZKTree(String root) {
 if (!LOG.isDebugEnabled()) return;
 LOG.debug("Current zk system:");
 String prefix = "|-";
 LOG.debug(prefix + root);
 try {
  logZKTree(root, prefix);
 } catch (KeeperException e) {
  throw new RuntimeException(e);
 }
}

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

/**
 * Helper method to print the current state of the ZK tree.
 * @see #logZKTree(String)
 * @throws KeeperException if an unexpected exception occurs
 */
protected void logZKTree(String root, String prefix) throws KeeperException {
 List<String> children = ZKUtil.listChildrenNoWatch(watcher, root);
 if (children == null) return;
 for (String child : children) {
  LOG.debug(prefix + child);
  String node = ZNodePaths.joinZNode(root.equals("/") ? "" : root, child);
  logZKTree(node, prefix + "---");
 }
}

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

public void clearZNodes(String procedureName) throws KeeperException {
  LOG.info("Clearing all znodes for procedure " + procedureName + "including nodes "
    + acquiredZnode + " " + reachedZnode + " " + abortZnode);

  // Make sure we trigger the watches on these nodes by creating them. (HBASE-13885)
  String acquiredBarrierNode = getAcquiredBarrierNode(procedureName);
  String reachedBarrierNode = getReachedBarrierNode(procedureName);
  String abortZNode = getAbortZNode(procedureName);

  ZKUtil.createAndFailSilent(watcher, acquiredBarrierNode);
  ZKUtil.createAndFailSilent(watcher, abortZNode);

  ZKUtil.deleteNodeRecursivelyMultiOrSequential(watcher, true, acquiredBarrierNode,
   reachedBarrierNode, abortZNode);

  if (LOG.isTraceEnabled()) {
   logZKTree(this.baseZNode);
  }
 }
}

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

/**
 * This is the abort message being sent by the coordinator to member
 *
 * TODO this code isn't actually used but can be used to issue a cancellation from the
 * coordinator.
 */
@Override
final public void sendAbortToMembers(Procedure proc, ForeignException ee) {
 String procName = proc.getName();
 LOG.debug("Aborting procedure '" + procName + "' in zk");
 String procAbortNode = zkProc.getAbortZNode(procName);
 try {
  LOG.debug("Creating abort znode:" + procAbortNode);
  String source = (ee.getSource() == null) ? coordName : ee.getSource();
  byte[] errorInfo = ProtobufUtil.prependPBMagic(ForeignException.serialize(source, ee));
  // first create the znode for the procedure
  ZKUtil.createAndFailSilent(zkProc.getWatcher(), procAbortNode, errorInfo);
  LOG.debug("Finished creating abort node:" + procAbortNode);
 } catch (KeeperException e) {
  // possible that we get this error for the procedure if we already reset the zk state, but in
  // that case we should still get an error for that procedure anyways
  zkProc.logZKTree(zkProc.baseZNode);
  coordinator.rpcConnectionFailure("Failed to post zk node:" + procAbortNode
    + " to abort procedure '" + procName + "'", new IOException(e));
 }
}

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

/**
 * This should be called by the member and should write a serialized root cause exception as
 * to the abort znode.
 */
@Override
public void sendMemberAborted(Subprocedure sub, ForeignException ee) {
 if (sub == null) {
  LOG.error("Failed due to null subprocedure", ee);
  return;
 }
 String procName = sub.getName();
 LOG.debug("Aborting procedure (" + procName + ") in zk");
 String procAbortZNode = zkController.getAbortZNode(procName);
 try {
  String source = (ee.getSource() == null) ? memberName: ee.getSource();
  byte[] errorInfo = ProtobufUtil.prependPBMagic(ForeignException.serialize(source, ee));
  ZKUtil.createAndFailSilent(zkController.getWatcher(), procAbortZNode, errorInfo);
  LOG.debug("Finished creating abort znode:" + procAbortZNode);
 } catch (KeeperException e) {
  // possible that we get this error for the procedure if we already reset the zk state, but in
  // that case we should still get an error for that procedure anyways
  zkController.logZKTree(zkController.getBaseZnode());
  member.controllerConnectionFailure("Failed to post zk node:" + procAbortZNode
    + " to abort procedure", e, procName);
 }
}

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

/**
 * Recursively print the current state of ZK (non-transactional)
 * @param root name of the root directory in zk to print
 * @throws KeeperException
 */
void logZKTree(String root) {
 if (!LOG.isDebugEnabled()) return;
 LOG.debug("Current zk system:");
 String prefix = "|-";
 LOG.debug(prefix + root);
 try {
  logZKTree(root, prefix);
 } catch (KeeperException e) {
  throw new RuntimeException(e);
 }
}

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

/**
 * Helper method to print the current state of the ZK tree.
 * @see #logZKTree(String)
 * @throws KeeperException if an unexpected exception occurs
 */
protected void logZKTree(String root, String prefix) throws KeeperException {
 List<String> children = ZKUtil.listChildrenNoWatch(watcher, root);
 if (children == null) return;
 for (String child : children) {
  LOG.debug(prefix + child);
  String node = ZKUtil.joinZNode(root.equals("/") ? "" : root, child);
  logZKTree(node, prefix + "---");
 }
}

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

/**
 * Helper method to print the current state of the ZK tree.
 * @see #logZKTree(String)
 * @throws KeeperException if an unexpected exception occurs
 */
protected void logZKTree(String root, String prefix) throws KeeperException {
 List<String> children = ZKUtil.listChildrenNoWatch(watcher, root);
 if (children == null) return;
 for (String child : children) {
  LOG.debug(prefix + child);
  String node = ZKUtil.joinZNode(root.equals("/") ? "" : root, child);
  logZKTree(node, prefix + "---");
 }
}

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

public void clearChildZNodes() throws KeeperException {
 LOG.info("Clearing all procedure znodes: " + acquiredZnode + " " + reachedZnode + " "
   + abortZnode);
 // If the coordinator was shutdown mid-procedure, then we are going to lose
 // an procedure that was previously started by cleaning out all the previous state. Its much
 // harder to figure out how to keep an procedure going and the subject of HBASE-5487.
 ZKUtil.deleteChildrenRecursivelyMultiOrSequential(watcher, true, acquiredZnode, reachedZnode,
  abortZnode);
 if (LOG.isTraceEnabled()) {
  logZKTree(this.baseZNode);
 }
}

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

/**
 * Recursively print the current state of ZK (non-transactional)
 * @param root name of the root directory in zk to print
 * @throws KeeperException
 */
void logZKTree(String root) {
 if (!LOG.isDebugEnabled()) return;
 LOG.debug("Current zk system:");
 String prefix = "|-";
 LOG.debug(prefix + root);
 try {
  logZKTree(root, prefix);
 } catch (KeeperException e) {
  throw new RuntimeException(e);
 }
}

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

/**
 * This is the abort message being sent by the coordinator to member
 *
 * TODO this code isn't actually used but can be used to issue a cancellation from the
 * coordinator.
 */
@Override
final public void sendAbortToMembers(Procedure proc, ForeignException ee) {
 String procName = proc.getName();
 LOG.debug("Aborting procedure '" + procName + "' in zk");
 String procAbortNode = zkProc.getAbortZNode(procName);
 try {
  LOG.debug("Creating abort znode:" + procAbortNode);
  String source = (ee.getSource() == null) ? coordName : ee.getSource();
  byte[] errorInfo = ProtobufUtil.prependPBMagic(ForeignException.serialize(source, ee));
  // first create the znode for the procedure
  ZKUtil.createAndFailSilent(zkProc.getWatcher(), procAbortNode, errorInfo);
  LOG.debug("Finished creating abort node:" + procAbortNode);
 } catch (KeeperException e) {
  // possible that we get this error for the procedure if we already reset the zk state, but in
  // that case we should still get an error for that procedure anyways
  zkProc.logZKTree(zkProc.baseZNode);
  coordinator.rpcConnectionFailure("Failed to post zk node:" + procAbortNode
    + " to abort procedure '" + procName + "'", new IOException(e));
 }
}

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

/**
 * This should be called by the member and should write a serialized root cause exception as
 * to the abort znode.
 */
@Override
public void sendMemberAborted(Subprocedure sub, ForeignException ee) {
 if (sub == null) {
  LOG.error("Failed due to null subprocedure", ee);
  return;
 }
 String procName = sub.getName();
 LOG.debug("Aborting procedure (" + procName + ") in zk");
 String procAbortZNode = zkController.getAbortZNode(procName);
 try {
  String source = (ee.getSource() == null) ? memberName: ee.getSource();
  byte[] errorInfo = ProtobufUtil.prependPBMagic(ForeignException.serialize(source, ee));
  ZKUtil.createAndFailSilent(zkController.getWatcher(), procAbortZNode, errorInfo);
  LOG.debug("Finished creating abort znode:" + procAbortZNode);
 } catch (KeeperException e) {
  // possible that we get this error for the procedure if we already reset the zk state, but in
  // that case we should still get an error for that procedure anyways
  zkController.logZKTree(zkController.getBaseZnode());
  member.controllerConnectionFailure("Failed to post zk node:" + procAbortZNode
    + " to abort procedure", new IOException(e));
 }
}

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

public void clearZNodes(String procedureName) throws KeeperException {
  LOG.info("Clearing all znodes for procedure " + procedureName + "including nodes "
    + acquiredZnode + " " + reachedZnode + " " + abortZnode);

  // Make sure we trigger the watches on these nodes by creating them. (HBASE-13885)
  String acquiredBarrierNode = getAcquiredBarrierNode(procedureName);
  String reachedBarrierNode = getReachedBarrierNode(procedureName);
  String abortZNode = getAbortZNode(procedureName);

  ZKUtil.createAndFailSilent(watcher, acquiredBarrierNode);
  ZKUtil.createAndFailSilent(watcher, abortZNode);

  ZKUtil.deleteNodeRecursivelyMultiOrSequential(watcher, true, acquiredBarrierNode,
   reachedBarrierNode, abortZNode);

  if (LOG.isTraceEnabled()) {
   logZKTree(this.baseZNode);
  }
 }
}

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

/**
 * This is the abort message being sent by the coordinator to member
 *
 * TODO this code isn't actually used but can be used to issue a cancellation from the
 * coordinator.
 */
@Override
final public void sendAbortToMembers(Procedure proc, ForeignException ee) {
 String procName = proc.getName();
 LOG.debug("Aborting procedure '" + procName + "' in zk");
 String procAbortNode = zkProc.getAbortZNode(procName);
 try {
  LOG.debug("Creating abort znode:" + procAbortNode);
  String source = (ee.getSource() == null) ? coordName : ee.getSource();
  byte[] errorInfo = ProtobufUtil.prependPBMagic(ForeignException.serialize(source, ee));
  // first create the znode for the procedure
  ZKUtil.createAndFailSilent(zkProc.getWatcher(), procAbortNode, errorInfo);
  LOG.debug("Finished creating abort node:" + procAbortNode);
 } catch (KeeperException e) {
  // possible that we get this error for the procedure if we already reset the zk state, but in
  // that case we should still get an error for that procedure anyways
  zkProc.logZKTree(zkProc.baseZNode);
  coordinator.rpcConnectionFailure("Failed to post zk node:" + procAbortNode
    + " to abort procedure '" + procName + "'", new IOException(e));
 }
}

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

/**
 * This should be called by the member and should write a serialized root cause exception as
 * to the abort znode.
 */
@Override
public void sendMemberAborted(Subprocedure sub, ForeignException ee) {
 if (sub == null) {
  LOG.error("Failed due to null subprocedure", ee);
  return;
 }
 String procName = sub.getName();
 LOG.debug("Aborting procedure (" + procName + ") in zk");
 String procAbortZNode = zkController.getAbortZNode(procName);
 try {
  String source = (ee.getSource() == null) ? memberName: ee.getSource();
  byte[] errorInfo = ProtobufUtil.prependPBMagic(ForeignException.serialize(source, ee));
  ZKUtil.createAndFailSilent(zkController.getWatcher(), procAbortZNode, errorInfo);
  LOG.debug("Finished creating abort znode:" + procAbortZNode);
 } catch (KeeperException e) {
  // possible that we get this error for the procedure if we already reset the zk state, but in
  // that case we should still get an error for that procedure anyways
  zkController.logZKTree(zkController.getBaseZnode());
  member.controllerConnectionFailure("Failed to post zk node:" + procAbortZNode
    + " to abort procedure", e, procName);
 }
}

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