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 Mon, 26 Dec 2016 23:16:47 GMT
Github user Randgalt commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/136#discussion_r93886806
  
    --- Diff: src/java/main/org/apache/zookeeper/server/WatchManager.java ---
    @@ -97,23 +102,44 @@ synchronized void removeWatcher(Watcher watcher) {
         Set<Watcher> triggerWatch(String path, EventType type, Set<Watcher> supress)
{
             WatchedEvent e = new WatchedEvent(type,
                     KeeperState.SyncConnected, path);
    -        HashSet<Watcher> watchers;
    +        Set<Watcher> watchers = new HashSet<>();
    +        PathIterator pathIterator = new PathIterator(path);
             synchronized (this) {
    -            watchers = watchTable.remove(path);
    -            if (watchers == null || watchers.isEmpty()) {
    -                if (LOG.isTraceEnabled()) {
    -                    ZooTrace.logTraceMessage(LOG,
    -                            ZooTrace.EVENT_DELIVERY_TRACE_MASK,
    -                            "No watchers for " + path);
    +            while (pathIterator.hasNext()) {
    --- End diff --
    
    See my comment above why this isn't practical


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