Zookeeper删除一个Znode下的所有节点
Zookeeper, Znode 介绍:https://blog.csdn.net/dslztx/article/details/51077606Java使用CuratorFramework ,删除Znodepublic class ZookeeperManager {private static CuratorFramework client;static {...
·
Zookeeper, Znode 介绍:
https://blog.csdn.net/dslztx/article/details/51077606
CuratorFramework
https://blog.csdn.net/u010889616/article/details/80209629
Java使用CuratorFramework ,删除Znode
public class ZookeeperManager {
private static CuratorFramework client;
public static CuratorFramework getZookeeperClient() {
return client;
}
这样只能删一个Znode,如果底下有子节点就删不掉了
ZookeeperManager.getZookeeperClient().delete().forPath(endpointPath);
这样才能删一个Znode和这个Znode下的所有子节点
ZookeeperManager.getZookeeperClient().delete().deletingChildrenIfNeeded().forPath(endpointPath);
更多推荐
已为社区贡献1条内容
所有评论(0)