zookeeper JavaApi 修改节点

*修改数据
* 1.修改数据
* 2.根据版本修改
*
*
* */
@Test
public void testSet() throws Exception{
    Stat stat = new Stat();
    client.getData().storingStatIn(stat).forPath("/app1");
    int version = stat.getVersion();
    client.setData().withVersion(version).forPath("/app1","itcast".getBytes());
}
posted @ 2023-08-04 16:57  会秃头的小白  阅读(16)  评论(0编辑  收藏  举报