Java API如何实现节点的更新、删除与读取操作?
- 内容介绍
- 文章标签
- 相关推荐
本文共计562个文字,预计阅读时间需要3分钟。
1. 更新+同步方式:/ *** 三个参数 + * 节点路径 + * 要设置的数据 + * 预期匹配版本 + / Stat stat=zooKeeper.setData(/set/node1, NODE1.getBytes(), 1); 返回值Stat中封装了set命令中的返回值,可。
1.更新
同步方式:
/** * 三个参数 * the path of the node * the data to set * the expected matching version */ Stat stat = zooKeeper.setData("/set/node1", "NODE1".getBytes(), 1);
返回值Stat中封装了set命令中的返回值,可以通过Stat的各种get方法去获取。
本文共计562个文字,预计阅读时间需要3分钟。
1. 更新+同步方式:/ *** 三个参数 + * 节点路径 + * 要设置的数据 + * 预期匹配版本 + / Stat stat=zooKeeper.setData(/set/node1, NODE1.getBytes(), 1); 返回值Stat中封装了set命令中的返回值,可。
1.更新
同步方式:
/** * 三个参数 * the path of the node * the data to set * the expected matching version */ Stat stat = zooKeeper.setData("/set/node1", "NODE1".getBytes(), 1);
返回值Stat中封装了set命令中的返回值,可以通过Stat的各种get方法去获取。

