本文整理了Java中org.apache.hadoop.hbase.zookeeper.ZKUtil.deleteChildrenRecursivelyMultiOrSequential()
方法的一些代码示例,展示了ZKUtil.deleteChildrenRecursivelyMultiOrSequential()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKUtil.deleteChildrenRecursivelyMultiOrSequential()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.zookeeper.ZKUtil
类名称:ZKUtil
方法名:deleteChildrenRecursivelyMultiOrSequential
[英]Delete all the children of the specified node but not the node itself. This will first traverse the znode tree for listing the children and then delete these znodes 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 all the children of the specified node but not the node itself.
*
* Sets no watches. Throws all exceptions besides dealing with deletion of
* children.
*
* @throws KeeperException if a ZooKeeper operation fails
*/
public static void deleteChildrenRecursively(ZKWatcher zkw, String node)
throws KeeperException {
deleteChildrenRecursivelyMultiOrSequential(zkw, true, node);
}
代码示例来源: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
/**
* Verifies that for the given root node, it should delete all the child nodes
* recursively using multi-update api.
*/
@Test
public void testdeleteChildrenRecursivelyMulti() throws Exception {
String parentZNode = "/testRootMulti";
createZNodeTree(parentZNode);
ZKUtil.deleteChildrenRecursivelyMultiOrSequential(zkw, true, parentZNode);
assertTrue("Wrongly deleted parent znode!",
ZKUtil.checkExists(zkw, parentZNode) > -1);
List<String> children = zkw.getRecoverableZooKeeper().getChildren(
parentZNode, false);
assertTrue("Failed to delete child znodes!", 0 == children.size());
}
代码示例来源:origin: apache/hbase
@Test
public void testDeleteChildrenRecursivelyMultiOrSequential() throws Exception {
String parentZNode1 = "/testdeleteChildren1";
String parentZNode2 = "/testdeleteChildren2";
String parentZNode3 = "/testdeleteChildren3";
createZNodeTree(parentZNode1);
createZNodeTree(parentZNode2);
createZNodeTree(parentZNode3);
ZKUtil.deleteChildrenRecursivelyMultiOrSequential(zkw, true, parentZNode1, parentZNode2,
parentZNode3);
assertTrue("Wrongly deleted parent znode 1!", ZKUtil.checkExists(zkw, parentZNode1) > -1);
List<String> children = zkw.getRecoverableZooKeeper().getChildren(parentZNode1, false);
assertTrue("Failed to delete child znodes of parent znode 1!", 0 == children.size());
assertTrue("Wrongly deleted parent znode 2!", ZKUtil.checkExists(zkw, parentZNode2) > -1);
children = zkw.getRecoverableZooKeeper().getChildren(parentZNode2, false);
assertTrue("Failed to delete child znodes of parent znode 1!", 0 == children.size());
assertTrue("Wrongly deleted parent znode 3!", ZKUtil.checkExists(zkw, parentZNode3) > -1);
children = zkw.getRecoverableZooKeeper().getChildren(parentZNode3, false);
assertTrue("Failed to delete child znodes of parent znode 1!", 0 == children.size());
}
代码示例来源:origin: org.apache.hbase/hbase-zookeeper
/**
* Delete all the children of the specified node but not the node itself.
*
* Sets no watches. Throws all exceptions besides dealing with deletion of
* children.
*
* @throws KeeperException if a ZooKeeper operation fails
*/
public static void deleteChildrenRecursively(ZKWatcher zkw, String node)
throws KeeperException {
deleteChildrenRecursivelyMultiOrSequential(zkw, true, node);
}
代码示例来源:origin: harbby/presto-connectors
/**
* Delete all the children of the specified node but not the node itself.
*
* Sets no watches. Throws all exceptions besides dealing with deletion of
* children.
*
* If hbase.zookeeper.useMulti is true, use ZooKeeper's multi-update functionality.
* Otherwise, run the list of operations sequentially.
*
* @throws KeeperException
*/
public static void deleteChildrenRecursively(ZooKeeperWatcher zkw, String node)
throws KeeperException {
deleteChildrenRecursivelyMultiOrSequential(zkw, true, node);
}
代码示例来源: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: org.apache.hbase/hbase-zookeeper
/**
* Verifies that for the given root node, it should delete all the child nodes
* recursively using multi-update api.
*/
@Test
public void testdeleteChildrenRecursivelyMulti() throws Exception {
String parentZNode = "/testRootMulti";
createZNodeTree(parentZNode);
ZKUtil.deleteChildrenRecursivelyMultiOrSequential(zkw, true, parentZNode);
assertTrue("Wrongly deleted parent znode!",
ZKUtil.checkExists(zkw, parentZNode) > -1);
List<String> children = zkw.getRecoverableZooKeeper().getChildren(
parentZNode, false);
assertTrue("Failed to delete child znodes!", 0 == children.size());
}
代码示例来源:origin: com.aliyun.hbase/alihbase-zookeeper
/**
* Verifies that for the given root node, it should delete all the child nodes
* recursively using multi-update api.
*/
@Test
public void testdeleteChildrenRecursivelyMulti() throws Exception {
String parentZNode = "/testRootMulti";
createZNodeTree(parentZNode);
ZKUtil.deleteChildrenRecursivelyMultiOrSequential(zkw, true, parentZNode);
assertTrue("Wrongly deleted parent znode!",
ZKUtil.checkExists(zkw, parentZNode) > -1);
List<String> children = zkw.getRecoverableZooKeeper().getChildren(
parentZNode, false);
assertTrue("Failed to delete child znodes!", 0 == children.size());
}
代码示例来源:origin: org.apache.hbase/hbase-zookeeper
@Test
public void testDeleteChildrenRecursivelyMultiOrSequential() throws Exception {
String parentZNode1 = "/testdeleteChildren1";
String parentZNode2 = "/testdeleteChildren2";
String parentZNode3 = "/testdeleteChildren3";
createZNodeTree(parentZNode1);
createZNodeTree(parentZNode2);
createZNodeTree(parentZNode3);
ZKUtil.deleteChildrenRecursivelyMultiOrSequential(zkw, true, parentZNode1, parentZNode2,
parentZNode3);
assertTrue("Wrongly deleted parent znode 1!", ZKUtil.checkExists(zkw, parentZNode1) > -1);
List<String> children = zkw.getRecoverableZooKeeper().getChildren(parentZNode1, false);
assertTrue("Failed to delete child znodes of parent znode 1!", 0 == children.size());
assertTrue("Wrongly deleted parent znode 2!", ZKUtil.checkExists(zkw, parentZNode2) > -1);
children = zkw.getRecoverableZooKeeper().getChildren(parentZNode2, false);
assertTrue("Failed to delete child znodes of parent znode 1!", 0 == children.size());
assertTrue("Wrongly deleted parent znode 3!", ZKUtil.checkExists(zkw, parentZNode3) > -1);
children = zkw.getRecoverableZooKeeper().getChildren(parentZNode3, false);
assertTrue("Failed to delete child znodes of parent znode 1!", 0 == children.size());
}
代码示例来源:origin: com.aliyun.hbase/alihbase-zookeeper
@Test
public void testDeleteChildrenRecursivelyMultiOrSequential() throws Exception {
String parentZNode1 = "/testdeleteChildren1";
String parentZNode2 = "/testdeleteChildren2";
String parentZNode3 = "/testdeleteChildren3";
createZNodeTree(parentZNode1);
createZNodeTree(parentZNode2);
createZNodeTree(parentZNode3);
ZKUtil.deleteChildrenRecursivelyMultiOrSequential(zkw, true, parentZNode1, parentZNode2,
parentZNode3);
assertTrue("Wrongly deleted parent znode 1!", ZKUtil.checkExists(zkw, parentZNode1) > -1);
List<String> children = zkw.getRecoverableZooKeeper().getChildren(parentZNode1, false);
assertTrue("Failed to delete child znodes of parent znode 1!", 0 == children.size());
assertTrue("Wrongly deleted parent znode 2!", ZKUtil.checkExists(zkw, parentZNode2) > -1);
children = zkw.getRecoverableZooKeeper().getChildren(parentZNode2, false);
assertTrue("Failed to delete child znodes of parent znode 1!", 0 == children.size());
assertTrue("Wrongly deleted parent znode 3!", ZKUtil.checkExists(zkw, parentZNode3) > -1);
children = zkw.getRecoverableZooKeeper().getChildren(parentZNode3, false);
assertTrue("Failed to delete child znodes of parent znode 1!", 0 == children.size());
}
内容来源于网络,如有侵权,请联系作者删除!