You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ca...@apache.org on 2018/12/10 03:46:37 UTC
[6/8] curator git commit: added for exists watcher also
added for exists watcher also
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/b7c902ae
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/b7c902ae
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/b7c902ae
Branch: refs/heads/CURATOR-477
Commit: b7c902ae01c58806e09316898883406ad5c7edd7
Parents: 7680e15
Author: Rama <ra...@salesforce.com>
Authored: Tue Sep 25 13:08:47 2018 +0530
Committer: Rama <ra...@salesforce.com>
Committed: Tue Sep 25 13:08:47 2018 +0530
----------------------------------------------------------------------
.../org/apache/curator/framework/recipes/cache/TreeCache.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/b7c902ae/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
index dc2afc5..e6119f5 100644
--- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
+++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
@@ -347,7 +347,11 @@ public class TreeCache implements Closeable
if ( parent == null )
{
// Root node; use an exist query to watch for existence.
- client.checkExists().usingWatcher(this).inBackground(this).forPath(path);
+ if (disableZkWatches) {
+ client.checkExists().forPath(path);
+ } else {
+ client.checkExists().usingWatcher(this).inBackground(this).forPath(path);
+ }
}
else
{