You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Anthony Urso (JIRA)" <ji...@apache.org> on 2008/07/04 03:52:49 UTC

[jira] Created: (ZOOKEEPER-66) Add NullWatcher, a watcher that does nothing

Add NullWatcher, a watcher that does nothing
--------------------------------------------

                 Key: ZOOKEEPER-66
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-66
             Project: Zookeeper
          Issue Type: New Feature
          Components: java client
            Reporter: Anthony Urso
            Priority: Minor


I found that I was repeating this code all over the place. Here is a NullWatcher class, a Watcher that does nothing at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-66) Add NullWatcher, a watcher that does nothing

Posted by "Anthony Urso (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-66?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anthony Urso updated ZOOKEEPER-66:
----------------------------------

    Comment: was deleted

> Add NullWatcher, a watcher that does nothing
> --------------------------------------------
>
>                 Key: ZOOKEEPER-66
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-66
>             Project: Zookeeper
>          Issue Type: New Feature
>          Components: java client
>            Reporter: Anthony Urso
>            Priority: Minor
>         Attachments: nullwatcher.diff
>
>
> I found that I was repeating this code all over the place. Here is a NullWatcher class, a Watcher that does nothing at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-66) Add NullWatcher, a watcher that does nothing

Posted by "Anthony Urso (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-66?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anthony Urso updated ZOOKEEPER-66:
----------------------------------

    Status: Patch Available  (was: Open)

Patch attached.

> Add NullWatcher, a watcher that does nothing
> --------------------------------------------
>
>                 Key: ZOOKEEPER-66
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-66
>             Project: Zookeeper
>          Issue Type: New Feature
>          Components: java client
>            Reporter: Anthony Urso
>            Priority: Minor
>
> I found that I was repeating this code all over the place. Here is a NullWatcher class, a Watcher that does nothing at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-66) Add NullWatcher, a watcher that does nothing

Posted by "Anthony Urso (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-66?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anthony Urso updated ZOOKEEPER-66:
----------------------------------

    Status: Patch Available  (was: Open)

Patch attached again.

> Add NullWatcher, a watcher that does nothing
> --------------------------------------------
>
>                 Key: ZOOKEEPER-66
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-66
>             Project: Zookeeper
>          Issue Type: New Feature
>          Components: java client
>            Reporter: Anthony Urso
>            Priority: Minor
>         Attachments: nullwatcher.diff
>
>
> I found that I was repeating this code all over the place. Here is a NullWatcher class, a Watcher that does nothing at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-66) Add NullWatcher, a watcher that does nothing

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-66?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Hunt updated ZOOKEEPER-66:
----------------------------------

    Resolution: Won't Fix
        Status: Resolved  (was: Patch Available)

Closing this issue. 

We don't want to encourage users to use null watchers. There are very limited cases where a null watcher might be useful - probably just during the initial "kicking the tires" phase of learning ZK. 

Implementing a production client requires the developer to implement a full watcher that is able to handle events and status changes (resetting watches if disconnected from the server for example).


> Add NullWatcher, a watcher that does nothing
> --------------------------------------------
>
>                 Key: ZOOKEEPER-66
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-66
>             Project: Zookeeper
>          Issue Type: New Feature
>          Components: java client
>            Reporter: Anthony Urso
>            Priority: Minor
>         Attachments: nullwatcher.diff
>
>
> I found that I was repeating this code all over the place. Here is a NullWatcher class, a Watcher that does nothing at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-66) Add NullWatcher, a watcher that does nothing

Posted by "Anthony Urso (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-66?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anthony Urso updated ZOOKEEPER-66:
----------------------------------

    Status: Open  (was: Patch Available)

Patch not attached.

> Add NullWatcher, a watcher that does nothing
> --------------------------------------------
>
>                 Key: ZOOKEEPER-66
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-66
>             Project: Zookeeper
>          Issue Type: New Feature
>          Components: java client
>            Reporter: Anthony Urso
>            Priority: Minor
>
> I found that I was repeating this code all over the place. Here is a NullWatcher class, a Watcher that does nothing at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-66) Add NullWatcher, a watcher that does nothing

Posted by "Flavio Paiva Junqueira (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-66?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610748#action_12610748 ] 

Flavio Paiva Junqueira commented on ZOOKEEPER-66:
-------------------------------------------------

I'm not entirely convinced that this is a good idea. The watcher is important for the communication between ZooKeeper and the client, and I can understand if you want to use a null watcher in the case you're implementing a quick program for debugging or perhaps test purposes, but in such cases implementing the Watcher interface and declaring a process method that does nothing doesn't seem like a huge burden to me. 

I'm affraid that by adding a null watcher, we'll give the impression to users that implementing a Watcher is not that important. 

> Add NullWatcher, a watcher that does nothing
> --------------------------------------------
>
>                 Key: ZOOKEEPER-66
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-66
>             Project: Zookeeper
>          Issue Type: New Feature
>          Components: java client
>            Reporter: Anthony Urso
>            Priority: Minor
>         Attachments: nullwatcher.diff
>
>
> I found that I was repeating this code all over the place. Here is a NullWatcher class, a Watcher that does nothing at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-66) Add NullWatcher, a watcher that does nothing

Posted by "Anthony Urso (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-66?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anthony Urso updated ZOOKEEPER-66:
----------------------------------

    Comment: was deleted

> Add NullWatcher, a watcher that does nothing
> --------------------------------------------
>
>                 Key: ZOOKEEPER-66
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-66
>             Project: Zookeeper
>          Issue Type: New Feature
>          Components: java client
>            Reporter: Anthony Urso
>            Priority: Minor
>         Attachments: nullwatcher.diff
>
>
> I found that I was repeating this code all over the place. Here is a NullWatcher class, a Watcher that does nothing at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-66) Add NullWatcher, a watcher that does nothing

Posted by "Anthony Urso (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-66?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anthony Urso updated ZOOKEEPER-66:
----------------------------------

    Attachment: nullwatcher.diff

Patch attached.

> Add NullWatcher, a watcher that does nothing
> --------------------------------------------
>
>                 Key: ZOOKEEPER-66
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-66
>             Project: Zookeeper
>          Issue Type: New Feature
>          Components: java client
>            Reporter: Anthony Urso
>            Priority: Minor
>         Attachments: nullwatcher.diff
>
>
> I found that I was repeating this code all over the place. Here is a NullWatcher class, a Watcher that does nothing at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-66) Add NullWatcher, a watcher that does nothing

Posted by "Andrew Kornev (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-66?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610882#action_12610882 ] 

Andrew Kornev commented on ZOOKEEPER-66:
----------------------------------------

I concur with Flavio: application must implement a watcher. At the very least you'd want to know about the session events such as connect, disconnect, and especially session expiration and athentication failure. The latter two cannot be automatically recovered from and must be handled by the application in a certain way (a new ZooKeeper object must be instantiated).

> Add NullWatcher, a watcher that does nothing
> --------------------------------------------
>
>                 Key: ZOOKEEPER-66
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-66
>             Project: Zookeeper
>          Issue Type: New Feature
>          Components: java client
>            Reporter: Anthony Urso
>            Priority: Minor
>         Attachments: nullwatcher.diff
>
>
> I found that I was repeating this code all over the place. Here is a NullWatcher class, a Watcher that does nothing at all.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.