You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Ted Dunning <te...@gmail.com> on 2012/01/19 00:50:46 UTC
redundant watches
I just had a question from an engineer regarding watches. I realized in
answering that I am not 100% sure that my answer is correct and would like
some confirmation.
The scenario is when redundant watches are set on a znode. The questions
are:
a) is there any adverse impact to redundant watches in which the same
Watcher object is set as watcher for the same operations on the same node.
(proposed answer: I don't think so. I think all watches will be triggered
in sequence just like non-redundant watches).
b) is there any way to determine whether a watch is already set or a list
of all watches already set? (proposed answer: I don't think so. There
certainly isn't any obvious way in the API to do this)
c) is there any way to cancel a watch. (proposed answer: I don't think so.
There has been recent action on this, but nothing final yet)
d) is there a way to create a watch such that there is exactly one watch
for the session on a particular znode? (proposed answer: I don't see any
way)
Can somebody confirm or deny these answers?
Re: redundant watches
Posted by Marshall McMullen <ma...@gmail.com>.
The only one I can confirm specifically is (b). There is no way to cancel a
watch. We really needed that feature in our code base that uses Zookeeper,
so we added a layer in our code base that achieves that result. And you're
right, I've seen a couple of Jira cases related to cancelling watches but
nothing has been officially merged that I'm aware of.
On Wed, Jan 18, 2012 at 4:50 PM, Ted Dunning <te...@gmail.com> wrote:
> I just had a question from an engineer regarding watches. I realized in
> answering that I am not 100% sure that my answer is correct and would like
> some confirmation.
>
> The scenario is when redundant watches are set on a znode. The questions
> are:
>
> a) is there any adverse impact to redundant watches in which the same
> Watcher object is set as watcher for the same operations on the same node.
> (proposed answer: I don't think so. I think all watches will be triggered
> in sequence just like non-redundant watches).
>
> b) is there any way to determine whether a watch is already set or a list
> of all watches already set? (proposed answer: I don't think so. There
> certainly isn't any obvious way in the API to do this)
>
> c) is there any way to cancel a watch. (proposed answer: I don't think so.
> There has been recent action on this, but nothing final yet)
>
> d) is there a way to create a watch such that there is exactly one watch
> for the session on a particular znode? (proposed answer: I don't see any
> way)
>
> Can somebody confirm or deny these answers?
>