Zookeeper实例ZkClient API-删除节点
来源:互联网 发布:粒子群算法工具箱 编辑:程序博客网 时间:2024/06/05 03:44
/** * * @ClassName: Del_Data_Sample * @Description: TODO(ZkClient删除节点数据) * @author * @date 2017年6月14日 下午12:53:56 * */public class Del_Data_Sample {public static void main(String[] args) throws Exception {String path = "/zk-book"; ZkClient zkClient = new ZkClient("localhost:2181", 2000); zkClient.createPersistent(path, ""); zkClient.createPersistent(path+"/c1", ""); zkClient.deleteRecursive(path); }}
注意:
Zookeeper在节点包含子节点的时候不可以删除这个节点,而ZkClient通过deleteRecurive这个接口自动帮我们逐层便利删除节点的工作。
扩展
参考
1.《从Paxos到Zookeeper:分布式一致性原理与实践》
2. http://javadox.com/com.101tec/zkclient/0.4/org/I0Itec/zkclient/ZkClient.html
阅读全文
0 0
- Zookeeper实例ZkClient API-删除节点
- Zookeeper实例ZkClient API-创建节点
- Zookeeper实例ZkClient API-更新节点内容
- Zookeeper实例ZkClient API-获取子节点列表
- Zookeeper实例ZkClient API-获取节点数据内容
- Zookeeper实例ZkClient API-检查节点是否存在
- Zookeeper实例原生API--删除节点
- Zookeeper实例ZkClient API-创建一个Zookeeper客户端
- Zookeeper API 和 Zkclient
- Zookeeper实例原生API--删除节点接口权限
- Zookeeper实例Curator API-使用Curator删除节点
- zookeeper zkclient API小案例
- Zookeeper原生API-ZkClient-Curator对比
- Zookeeper实例原生API--同步创建节点
- Zookeeper实例原生API--异步创建节点
- ZkClient之删除节点、更新节点、检测节点是否存在。
- Zookeeper实例Curator API-NodeCache节点不存在实例
- ZooKeeper之Java客户端API使用—删除节点。
- android listview/ScrollView 去除顶部下拉时的半月形阴影和上下滑动顶部和底部的虚化
- 413. Arithmetic Slices
- textarea 文本框禁止拖动改变大小
- 一个可以自动生成CSS样式前缀的脚本---Prefixfree.js
- java异常详解
- Zookeeper实例ZkClient API-删除节点
- Oracle基本命令
- 排名
- 【css】下拉菜单那些事儿
- 悬镜安全实验室携新产品“云鉴”亮相NSC2017中国网络安全大会
- 【操作系统】处理机调度的层次和调度算法的目标
- 亚军进化史---去深圳之前的大学最后狂欢
- 解决浅拷贝的几种方式
- Zookeeper实例ZkClient API-获取子节点列表