gpt4 book ai didi

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

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

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

ZKProcedureUtil.getAcquireBarrierNode介绍

[英]Get the full znode path for the node used by the coordinator to trigger a global barrier acquire on each subprocedure.
[中]获取协调器用于在每个子流程上触发全局屏障获取的节点的完整znode路径。

代码示例

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

public String getAcquiredBarrierNode(String opInstanceName) {
 return ZKProcedureUtil.getAcquireBarrierNode(this, opInstanceName);
}

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

/**
 * This attempts to create an acquired state znode for the procedure (snapshot name).
 *
 * It then looks for the reached znode to trigger in-barrier execution.  If not present we
 * have a watcher, if present then trigger the in-barrier action.
 */
@Override
public void sendMemberAcquired(Subprocedure sub) throws IOException {
 String procName = sub.getName();
 try {
  LOG.debug("Member: '" + memberName + "' joining acquired barrier for procedure (" + procName
    + ") in zk");
  String acquiredZNode = ZNodePaths.joinZNode(ZKProcedureUtil.getAcquireBarrierNode(
   zkController, procName), memberName);
  ZKUtil.createAndFailSilent(zkController.getWatcher(), acquiredZNode);
  // watch for the complete node for this snapshot
  String reachedBarrier = zkController.getReachedBarrierNode(procName);
  LOG.debug("Watch for global barrier reached:" + reachedBarrier);
  if (ZKUtil.watchAndCheckExists(zkController.getWatcher(), reachedBarrier)) {
   receivedReachedGlobalBarrier(reachedBarrier);
  }
 } catch (KeeperException e) {
  member.controllerConnectionFailure("Failed to acquire barrier for procedure: "
    + procName + " and member: " + memberName, e, procName);
 }
}

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

String prepare = ZKProcedureUtil.getAcquireBarrierNode(controller.getZkController(), operationName);
ZKUtil.createSetData(watcher, prepare, ProtobufUtil.prependPBMagic(data));

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

/**
 * Verify that the prepare, commit and abort nodes for the operation are removed from zookeeper
 */
private void verifyZooKeeperClean(String operationName, ZKWatcher watcher,
  ZKProcedureUtil controller) throws Exception {
 String prepare = ZKProcedureUtil.getAcquireBarrierNode(controller, operationName);
 String commit = ZKProcedureUtil.getReachedBarrierNode(controller, operationName);
 String abort = ZKProcedureUtil.getAbortNode(controller, operationName);
 assertEquals("Didn't delete prepare node", -1, ZKUtil.checkExists(watcher, prepare));
 assertEquals("Didn't delete commit node", -1, ZKUtil.checkExists(watcher, commit));
 assertEquals("Didn't delete abort node", -1, ZKUtil.checkExists(watcher, abort));
}

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

public String getAcquiredBarrierNode(String opInstanceName) {
 return ZKProcedureUtil.getAcquireBarrierNode(this, opInstanceName);
}

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

public String getAcquiredBarrierNode(String opInstanceName) {
 return ZKProcedureUtil.getAcquireBarrierNode(this, opInstanceName);
}

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

/**
 * This attempts to create an acquired state znode for the procedure (snapshot name).
 *
 * It then looks for the reached znode to trigger in-barrier execution.  If not present we
 * have a watcher, if present then trigger the in-barrier action.
 */
@Override
public void sendMemberAcquired(Subprocedure sub) throws IOException {
 String procName = sub.getName();
 try {
  LOG.debug("Member: '" + memberName + "' joining acquired barrier for procedure (" + procName
    + ") in zk");
  String acquiredZNode = ZKUtil.joinZNode(ZKProcedureUtil.getAcquireBarrierNode(
   zkController, procName), memberName);
  ZKUtil.createAndFailSilent(zkController.getWatcher(), acquiredZNode);
  // watch for the complete node for this snapshot
  String reachedBarrier = zkController.getReachedBarrierNode(procName);
  LOG.debug("Watch for global barrier reached:" + reachedBarrier);
  if (ZKUtil.watchAndCheckExists(zkController.getWatcher(), reachedBarrier)) {
   receivedReachedGlobalBarrier(reachedBarrier);
  }
 } catch (KeeperException e) {
  member.controllerConnectionFailure("Failed to acquire barrier for procedure: "
    + procName + " and member: " + memberName, new IOException(e));
 }
}

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

String prepare = ZKProcedureUtil.getAcquireBarrierNode(controller.getZkController(), operationName);
ZKUtil.createSetData(watcher, prepare, ProtobufUtil.prependPBMagic(data));

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

/**
 * This attempts to create an acquired state znode for the procedure (snapshot name).
 *
 * It then looks for the reached znode to trigger in-barrier execution.  If not present we
 * have a watcher, if present then trigger the in-barrier action.
 */
@Override
public void sendMemberAcquired(Subprocedure sub) throws IOException {
 String procName = sub.getName();
 try {
  LOG.debug("Member: '" + memberName + "' joining acquired barrier for procedure (" + procName
    + ") in zk");
  String acquiredZNode = ZKUtil.joinZNode(ZKProcedureUtil.getAcquireBarrierNode(
   zkController, procName), memberName);
  ZKUtil.createAndFailSilent(zkController.getWatcher(), acquiredZNode);
  // watch for the complete node for this snapshot
  String reachedBarrier = zkController.getReachedBarrierNode(procName);
  LOG.debug("Watch for global barrier reached:" + reachedBarrier);
  if (ZKUtil.watchAndCheckExists(zkController.getWatcher(), reachedBarrier)) {
   receivedReachedGlobalBarrier(reachedBarrier);
  }
 } catch (KeeperException e) {
  member.controllerConnectionFailure("Failed to acquire barrier for procedure: "
    + procName + " and member: " + memberName, e, procName);
 }
}

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

/**
 * Verify that the prepare, commit and abort nodes for the operation are removed from zookeeper
 */
private void verifyZooKeeperClean(String operationName, ZKWatcher watcher,
  ZKProcedureUtil controller) throws Exception {
 String prepare = ZKProcedureUtil.getAcquireBarrierNode(controller, operationName);
 String commit = ZKProcedureUtil.getReachedBarrierNode(controller, operationName);
 String abort = ZKProcedureUtil.getAbortNode(controller, operationName);
 assertEquals("Didn't delete prepare node", -1, ZKUtil.checkExists(watcher, prepare));
 assertEquals("Didn't delete commit node", -1, ZKUtil.checkExists(watcher, commit));
 assertEquals("Didn't delete abort node", -1, ZKUtil.checkExists(watcher, abort));
}

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