ZooKeeper级联删除javaAPI
来源:互联网 发布:菜鸟教程vue.js 编辑:程序博客网 时间:2024/06/11 11:19
package cn.ssy.zk.api;import java.util.List;import org.apache.zookeeper.ZooKeeper;public class ZKAPIDemoTest { private static String connectString ="hadoop02:2181"; private static int sessionTimeout=5000; public static void main(String[] args) throws Exception { //创建节点 ZooKeeper zk = new ZooKeeper(connectString, sessionTimeout, null); rmr("/zk01"); zk.close(); } public static boolean rmr(String path) throws Exception{ ZooKeeper zk = new ZooKeeper(connectString, sessionTimeout, null); String childrenPath = null; List<String> children = zk.getChildren(path, false); if (children.size()!=0){ for(String child: children){ childrenPath=path+"/"+child; if(childrenPath.isEmpty()){ zk.delete(childrenPath, -1); }else rmr(childrenPath); System.out.println(childrenPath); } } zk.delete(path, -1); return false; }}
阅读全文
0 0
- ZooKeeper级联删除javaAPI
- zookeeper javaAPI
- zookeeper JavaAPI入门操作
- zookeeper-05-javaAPI使用
- Zookeeper中javaAPI初试
- zookeeper javaApi/zkclient
- Zookeeper JavaApi 增删改查
- zookeeper javaapi 的使用测试
- zookeeper javaapi简单小例子
- zookeeper学习记录-06 Zookeeper JavaAPI操作
- 级联删除
- 级联删除
- 级联删除
- 级联删除
- 级联删除
- 级联删除
- 级联删除
- 级联删除
- 【Java】类名.class, class.forName(), getClass()区别
- 经典sql语句大全
- Python 进度条 tqdm
- UIViewController添加UICollectionView控件顶端出现留白的解决办法
- 安卓学习AIDL这篇就够了
- ZooKeeper级联删除javaAPI
- 响应式web-媒体查询
- jQuery替换url参数
- Fibonacci again and again (尼姆博弈 nim game)
- 06_堆排序
- angular学习笔记-数据绑定
- 过几年我还要回头看看这篇文章
- bzoj 3091 城市旅行
- 网络图片浏览器