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/master
Commit: b7c902ae01c58806e09316898883406ad5c7edd7
Parents: 7680e15
Author: Rama <[email protected]>
Authored: Tue Sep 25 13:08:47 2018 +0530
Committer: Rama <[email protected]>
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
             {

Reply via email to