本文整理了Java中org.apache.hadoop.hbase.zookeeper.ZKUtil.deleteNodeRecursivelyMultiOrSequential()
方法的一些代码示例,展示了ZKUtil.deleteNodeRecursivelyMultiOrSequential()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKUtil.deleteNodeRecursivelyMultiOrSequential()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.zookeeper.ZKUtil
类名称:ZKUtil
方法名:deleteNodeRecursivelyMultiOrSequential
[英]Delete the specified node and its children. This traverse the znode tree for listing the children and then delete these znodes including the parent using multi-update api or sequential based on the specified configurations.
Sets no watches. Throws all exceptions besides dealing with deletion of children.
If the following is true:
代码示例来源:origin: apache/hbase
/**
* Delete the specified node and all of it's children.
* <p>
* If the node does not exist, just returns.
* <p>
* Sets no watches. Throws all exceptions besides dealing with deletion of
* children.
*/
public static void deleteNodeRecursively(ZKWatcher zkw, String node)
throws KeeperException {
deleteNodeRecursivelyMultiOrSequential(zkw, true, node);
}
代码示例来源: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
@Test
public void testDeleteNodeRecursivelyMultiOrSequential() throws Exception {
String parentZNode1 = "/testdeleteNode1";
String parentZNode2 = "/testdeleteNode2";
String parentZNode3 = "/testdeleteNode3";
createZNodeTree(parentZNode1);
createZNodeTree(parentZNode2);
createZNodeTree(parentZNode3);
ZKUtil.deleteNodeRecursivelyMultiOrSequential(zkw, false, parentZNode1, parentZNode2,
parentZNode3);
assertTrue("Parent znode 1 should be deleted.", ZKUtil.checkExists(zkw, parentZNode1) == -1);
assertTrue("Parent znode 2 should be deleted.", ZKUtil.checkExists(zkw, parentZNode2) == -1);
assertTrue("Parent znode 3 should be deleted.", ZKUtil.checkExists(zkw, parentZNode3) == -1);
}
代码示例来源:origin: harbby/presto-connectors
/**
* Delete the specified node and all of it's children.
* <p>
* If the node does not exist, just returns.
* <p>
* Sets no watches. Throws all exceptions besides dealing with deletion of
* children.
*/
public static void deleteNodeRecursively(ZooKeeperWatcher zkw, String node)
throws KeeperException {
deleteNodeRecursivelyMultiOrSequential(zkw, true, node);
}
代码示例来源:origin: org.apache.hbase/hbase-zookeeper
/**
* Delete the specified node and all of it's children.
* <p>
* If the node does not exist, just returns.
* <p>
* Sets no watches. Throws all exceptions besides dealing with deletion of
* children.
*/
public static void deleteNodeRecursively(ZKWatcher zkw, String node)
throws KeeperException {
deleteNodeRecursivelyMultiOrSequential(zkw, true, node);
}
代码示例来源: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: com.aliyun.hbase/alihbase-zookeeper
@Test
public void testDeleteNodeRecursivelyMultiOrSequential() throws Exception {
String parentZNode1 = "/testdeleteNode1";
String parentZNode2 = "/testdeleteNode2";
String parentZNode3 = "/testdeleteNode3";
createZNodeTree(parentZNode1);
createZNodeTree(parentZNode2);
createZNodeTree(parentZNode3);
ZKUtil.deleteNodeRecursivelyMultiOrSequential(zkw, false, parentZNode1, parentZNode2,
parentZNode3);
assertTrue("Parent znode 1 should be deleted.", ZKUtil.checkExists(zkw, parentZNode1) == -1);
assertTrue("Parent znode 2 should be deleted.", ZKUtil.checkExists(zkw, parentZNode2) == -1);
assertTrue("Parent znode 3 should be deleted.", ZKUtil.checkExists(zkw, parentZNode3) == -1);
}
代码示例来源:origin: org.apache.hbase/hbase-zookeeper
@Test
public void testDeleteNodeRecursivelyMultiOrSequential() throws Exception {
String parentZNode1 = "/testdeleteNode1";
String parentZNode2 = "/testdeleteNode2";
String parentZNode3 = "/testdeleteNode3";
createZNodeTree(parentZNode1);
createZNodeTree(parentZNode2);
createZNodeTree(parentZNode3);
ZKUtil.deleteNodeRecursivelyMultiOrSequential(zkw, false, parentZNode1, parentZNode2,
parentZNode3);
assertTrue("Parent znode 1 should be deleted.", ZKUtil.checkExists(zkw, parentZNode1) == -1);
assertTrue("Parent znode 2 should be deleted.", ZKUtil.checkExists(zkw, parentZNode2) == -1);
assertTrue("Parent znode 3 should be deleted.", ZKUtil.checkExists(zkw, parentZNode3) == -1);
}
内容来源于网络,如有侵权,请联系作者删除!