GitHub user Randgalt opened a pull request: https://github.com/apache/zookeeper/pull/136
[ZOOKEEPER-1416] Persistent Recursive Watch Here is a completed implementation for a persistent, recursive watch addition for ZK. These watches are set via a new method, `addPersistentWatch()` and are removed via the existing watcher removal methods. Persistent, recursive watches have these characteristics: - Once set, they do not auto-remove when triggered - They trigger for all event types (child, data, etc.) on the node they are registered for and any child znode recursively. - They are efficiently implemented by using the existing watch internals. A new class `PathIterator` walks up the path parent-by-parent when checking if a watcher applies. Persistent watcher specific tests are in `PersistentWatcherTest.java`. I'd appreciated feedback on other additional tests that should be added. You can merge this pull request into a Git repository by running: $ git pull https://github.com/Randgalt/zookeeper ZOOKEEPER-1416 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/zookeeper/pull/136.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #136 ---- commit 3c05c671d09e5b6df936af8f0a700995d5749e11 Author: randgalt <jor...@jordanzimmerman.com> Date: 2016-12-25T21:36:13Z basic work done. Needs more testing, tuning, etc. commit ca4a000dcf294aaebd09d3118ebc62cb0783f9cc Author: randgalt <jor...@jordanzimmerman.com> Date: 2016-12-26T15:06:55Z working on persistent watcher removal commit bf13deda0b00ca67cd1fa963961d95a22634ed88 Author: randgalt <jor...@jordanzimmerman.com> Date: 2016-12-26T17:59:04Z Support resetting persistent watches commit 27d8d6cd45cb6adfabf50143f6de62a371447519 Author: randgalt <jor...@jordanzimmerman.com> Date: 2016-12-26T18:21:17Z docs commit 2766fb1020c600af579a0f701fa3c00ea92b7e22 Author: randgalt <jor...@jordanzimmerman.com> Date: 2016-12-26T18:44:42Z containsWatcher() was broken for STANDARD watchers commit 86fa1fbcb75021179f80588a2ea46aad2127fb4e Author: randgalt <jor...@jordanzimmerman.com> Date: 2016-12-26T19:20:00Z removed unused import commit b490c84d1e56335ba66f9c56d64134886b144451 Author: randgalt <jor...@jordanzimmerman.com> Date: 2016-12-26T19:20:08Z Updated doc for persistent watches ---- --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---