You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/12/02 21:04:08 UTC

[GitHub] [accumulo] ctubbsii commented on a change in pull request #1443: Fixes #1220 - Removes ZooKeeper watches on table configs when table is deleted.

ctubbsii commented on a change in pull request #1443: Fixes #1220  -  Removes ZooKeeper watches on table configs when table is deleted.
URL: https://github.com/apache/accumulo/pull/1443#discussion_r352816759
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java
 ##########
 @@ -155,8 +167,22 @@ public void process(WatchedEvent event) {
       }
 
       switch (event.getType()) {
-        case NodeDataChanged:
         case NodeChildrenChanged:
+          if (event.getPath().endsWith("conf")) {
+            Matcher confDirMatcher = TABLE_CONFIG_DIR_PATTERN.matcher(event.getPath());
+            if (confDirMatcher.matches()) {
+              try {
+                clear(event.getPath());
+                getZooKeeper().exists(event.getPath(), watcher);
+                if (log.isTraceEnabled()) {
+                  log.trace("NodeChildrenChanged: resetting watcher for " + event.getPath());
+                }
 
 Review comment:
   In slf4j, the following would accomplish the same thing without the need for checking `log.isTraceEnabled()`:
   ```java
     log.trace("NodeChildrenChanged: resetting watcher for {}", event.getPath());
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services