Github user Randgalt commented on a diff in the pull request:
https://github.com/apache/curator/pull/56#discussion_r30067034
--- Diff:
curator-framework/src/main/java/org/apache/curator/framework/imps/RemoveWatchesBuilderImpl.java
---
@@ -0,0 +1,214 @@
+package org.apache.curator.framework.imps;
+
+import java.util.concurrent.Callable;
+import java.util.concurrent.Executor;
+
+import org.apache.curator.RetryLoop;
+import org.apache.curator.TimeTrace;
+import org.apache.curator.framework.api.BackgroundCallback;
+import org.apache.curator.framework.api.BackgroundPathable;
+import org.apache.curator.framework.api.BackgroundPathableQuietly;
+import org.apache.curator.framework.api.CuratorEvent;
+import org.apache.curator.framework.api.CuratorEventType;
+import org.apache.curator.framework.api.CuratorWatcher;
+import org.apache.curator.framework.api.Pathable;
+import org.apache.curator.framework.api.RemoveWatchesLocal;
+import org.apache.curator.framework.api.RemoveWatchesBuilder;
+import org.apache.curator.framework.api.RemoveWatchesType;
+import org.apache.zookeeper.AsyncCallback;
+import org.apache.zookeeper.KeeperException;
+import org.apache.zookeeper.Watcher;
+import org.apache.zookeeper.Watcher.WatcherType;
+import org.apache.zookeeper.ZooKeeper;
+
+
+public class RemoveWatchesBuilderImpl implements RemoveWatchesBuilder,
RemoveWatchesType, RemoveWatchesLocal, BackgroundOperation<String>
+{
+ private CuratorFrameworkImpl client;
+ private Watcher watcher;
+ private WatcherType watcherType;
+ private boolean local;
+ private boolean quietly;
+ private Backgrounding backgrounding;
+
+ public RemoveWatchesBuilderImpl(CuratorFrameworkImpl client)
+ {
+ this.client = client;
+ this.watcher = null;
+ this.watcherType = null;
+ this.local = false;
+ this.quietly = false;
+ this.backgrounding = new Backgrounding();
+ }
+
+ @Override
+ public RemoveWatchesType remove(Watcher watcher)
+ {
+ this.watcher = watcher == null ? null :
client.getNamespaceWatcherMap().getNamespaceWatcher(watcher);
--- End diff --
<code> client.getNamespaceWatcherMap().getNamespaceWatcher(watcher)</code>
will add a namespace watcher record if it doesn't exist. That doesn't seem
right for removal. A new method in NamespaceWatcherMap is probably needed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---