我使用策展人为Zookeeper.I编程,我想看一下zonde.My代码的子节点如下:
CuratorFramework frameWork = CuratorFrameworkFactory.builder()
.retryPolicy(new RetryNTimes(3, 1000))
.connectString("127.0.0.1:2181").build();
frameWork.start();
CuratorWatcher watcher = new CuratorWatcher () {
@Override
public void process(WatchedEvent event) throws Exception {
System.out.println("event :" + event);
}
};
frameWork.getChildren().usingWatcher(watcher).forPath("/aa");
frameWork.setData().forPath("/aa/dd", "asdfd".getBytes());当调用"/aa/dd“的集合数据时,我希望观察者是triggered.But失败的,请有人知道吗?
发布于 2017-09-20 15:32:03
馆长有一个菜谱可以做到这一点。请参阅TreeCache:http://curator.apache.org/curator-recipes/tree-cache.html
https://stackoverflow.com/questions/46316331
复制相似问题