forked from apache/zookeeper
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZOOKEEPER-4471: Match removing WatcherType to standard, persistent mo…
…des (apache#1998) (#51) * ZOOKEEPER-4471: Match removing WatcherType to standard, persistent modes Before ZOOKEEPER-1416, `WatcherType.Children` was used to remove watchers attached through `ZooKeeper.getChildren`. `WatcherType.Data` was used to remove watchers attached through `ZooKeeper.getData` and `ZooKeeper.exists`. ZOOKEEPER-1416 adds `AddWatchMode.PERSISTENT`. This watcher could be completed remove using `WatcherType.Any`. But when removing through `WatcherType.Data` or `WatcherType.Children`, part of `AddWatchMode.PERSISTENT` will be left behind. And we get persistent children or data watchers. We are never claiming to support these type of watchers. So fix it. In rare chance, we are going to support persistent data or children watchers in future, I think we probably don't want to do such "magic" thing in ZooKeeper. So fix it. This is a step towards ZOOKEEPER-4472 which proposed to support `WatcherType.Persistent` and `WatcherType.PersistentRecursive` to remove persistent watchers. * Refactor newly added tests in WatchManagerTest I found it somewhat hard to follow in self-review. Add given-when-then comments from my best hope for reviewing and maintenance. Co-authored-by: Kezhu Wang <kezhuw@gmail.com>
- Loading branch information
1 parent
6230355
commit 64309a0
Showing
5 changed files
with
466 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.