/*
* 删除节点
* 1.删除单个节点
* 2.删除带有子节点的节点
* 3.必须成功的删除
* 4.回调
*
* */
@Test
public void delete1() throws Exception{
// 1.删除单个节点
client.delete().forPath("/app1");
}
@Test
public void delete2() throws Exception{
//2.删除带有子节点的节点
client.delete().deletingChildrenIfNeeded().forPath("/app4");
}
@Test
public void delete3() throws Exception{
//3.必须成功的删除
client.delete().guaranteed().forPath("/app2");
}
@Test
public void delete4() throws Exception{
//4.回调
client.delete().guaranteed().inBackground(new BackgroundCallback() {
@Override
public void processResult(CuratorFramework curatorFramework, CuratorEvent curatorEvent) throws Exception {
System.out.println("我被删除了");
System.out.println(curatorEvent);
}
}).forPath("/app2");
}
标签:Exception,throws,删除,void,zookeeper,节点,JavaApi,public
From: https://www.cnblogs.com/lin513/p/17606495.html