curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cammckenzie <...@git.apache.org>
Subject [GitHub] curator pull request: Curator 161
Date Mon, 11 May 2015 21:49:13 GMT
Github user cammckenzie commented on a diff in the pull request:

    https://github.com/apache/curator/pull/56#discussion_r30086182
  
    --- 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 --
    
    I guess if we don't have a reference in the NamespaceWatcherMap then we pass the watcher
through to the ZK client without it being wrapper in a NamespaceWatcher. The only reason I
can think of a watcher not being in the map would be if it was registered directly with the
ZK client without going through the ZK framework. Either way, if it doesn't exist it will
result in a NoWatcherException


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message