[
https://issues.apache.org/jira/browse/ZOOKEEPER-1830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13881721#comment-13881721
]
Raul Gutierrez Segales commented on ZOOKEEPER-1830:
---------------------------------------------------
Nit:
{noformat}
+ boolean local = false;
+ if (cl.hasOption("l")) {
+ local = true;
+ }
{noformat}
simplify to:
{noformat}
+ boolean local = cl.hasOption("l");
{noformat}
Nit:
{noformat}
+ Assert.assertEquals("Didn't recieves DataWatchRemoved!", 1,
+ pathVsEvent.size());
+ Assert.assertEquals("Didn't recieves DataWatchRemoved!",
{noformat}
typos: "Didn't receive DataWatchRemoved!".
And some more:
{noformat}
+ Assert.assertEquals("Didn't recieves ChildWatchRemoved!", 1,
+ pathVsEvent.size());
+ Assert.assertEquals("Didn't recieves ChildWatchRemoved!",
{noformat}
"Didn't receive ...". (there are more instance of "recieves" below).
Nit:
{noformat}
+
+ @Override
+ public void process(WatchedEvent event) {
+ switch (event.getType()) {
+ case ChildWatchRemoved: {
+ addWatchNotifications(pathVsEvent, event);
+ watcherLatch.countDown();
+ break;
+ }
+ case DataWatchRemoved: {
+ addWatchNotifications(pathVsEvent, event);
+ watcherLatch.countDown();
+ break;
+ }
+ case NodeChildrenChanged: {
+ addWatchNotifications(pathVsEvent, event);
+ break;
+ }
+ case NodeDataChanged: {
+ addWatchNotifications(pathVsEvent, event);
+ break;
+ }
+ }
+ }
{noformat}
You can group some cases:
{noformat}
+
+ @Override
+ public void process(WatchedEvent event) {
+ switch (event.getType()) {
+ case ChildWatchRemoved:
+ case DataWatchRemoved: {
+ addWatchNotifications(pathVsEvent, event);
+ watcherLatch.countDown();
+ break;
+ }
+ case NodeChildrenChanged:
+ case NodeDataChanged: {
+ addWatchNotifications(pathVsEvent, event);
+ break;
+ }
+ }
+ }
{noformat}
> Support command line shell for removing watches
> -----------------------------------------------
>
> Key: ZOOKEEPER-1830
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1830
> Project: ZooKeeper
> Issue Type: Sub-task
> Reporter: Rakesh R
> Assignee: Rakesh R
> Priority: Critical
> Fix For: 3.5.0
>
> Attachments: ZOOKEEPER-1830.patch
>
>
> This JIRA to discuss the command line shell for removing watches. Makes it
> easier to do ad-hoc testing.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)