curator を使用treeCache
する場合、キャッシュの準備ができていることを確認するにはどうすればよいですか?
の後、すぐcache.start()
に呼び出すと が返されるので、キャッシュの準備ができていることを確認するにはどうすればよいですか? 誰か例を教えてください。ありがとうgetCurrentData
null
client = CuratorFrameworkFactory.builder()
.connectString(connectionString)
.retryPolicy(new ExponentialBackoffRetry(zkConnectionTimeoutMs, 3))
.sessionTimeoutMs(zkSessionTimeoutMs)
.build();
client.start();
cache = new TreeCache(client, rootPath);
cache.start();
ChildData child = cache.getCurrentData(rootPath); // child is null
Thread.sleep(50); // must sleep for a while
child = cache.getCurrentData(rootPath); // child is ok