zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randgalt <...@git.apache.org>
Subject [GitHub] zookeeper pull request #136: [ZOOKEEPER-1416] Persistent Recursive Watch
Date Tue, 08 Aug 2017 21:14:28 GMT
Github user Randgalt commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/136#discussion_r132034244
  
    --- Diff: src/java/main/org/apache/zookeeper/server/WatchManager.java ---
    @@ -181,11 +206,18 @@ synchronized void dumpWatches(PrintWriter pwriter, boolean byPath)
{
          * @return true if the watcher exists, false otherwise
          */
         synchronized boolean containsWatcher(String path, Watcher watcher) {
    -        HashSet<String> paths = watch2Paths.get(watcher);
    -        if (paths == null || !paths.contains(path)) {
    -            return false;
    +        PathIterator pathIterator = new PathIterator(path);
    +        for (String localPath : pathIterator.asIterable()) {
    +            Map<Watcher, Type> watchers = watchTable.get(localPath);
    +            Type watcherType = (watchers != null) ? watchers.get(watcher) : null;
    +            if ((watcherType == Type.STANDARD) && !pathIterator.atParentPath())
{
    --- End diff --
    
    I'll check this.


---
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