curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jordan Zimmerman <jor...@jordanzimmerman.com>
Subject Re: PathChildrenCache : Accuracy
Date Fri, 21 Oct 2016 13:42:27 GMT
> PathChildrenCache[1] is the solution you have provided to watch on a given node without
using native zookeeper watchers.

PathChildrenCache uses native watchers. Have a look at the source. 

> Can anyone please clarify how the above effect can affect the accuracy of events listened?

The point of that message is to remind you that ZooKeeper is an eventually consistent system.
You are always seeing the view that the server you are connected to has. This is a feature
of ZooKeeper, not Curator.

Hope this helps.

-Jordan

> On Oct 21, 2016, at 4:44 AM, Imesha Sudasingha <imesha.13@cse.mrt.ac.lk> wrote:
> 
> Hi all,
> 
> I have been using apache zookeeper. Now I'm willing to switch to CuratorFramework as
it contains many useful recipes inbuilt. 
> 
> PathChildrenCache[1] is the solution you have provided to watch on a given node without
using native zookeeper watchers. As I went through the API [1] documentation, the following
ambiguous sentence has caused me to think twice as I want consistency accuracy for my implementation
(such as not missing CHILD_CREATED events).
> 
> "it's not possible to stay transactionally in sync. Users of this class must be prepared
for false-positives and false-negatives. Additionally, always use the version number when
updating data to avoid overwriting another process' change."
> 
> Can anyone please clarify how the above effect can affect the accuracy of events listened?
And is there a way to w atch on a given node without using Zookeeper watchers and PathChildrenCache?
> 
> (PathChildrenCache has the functionality I required. But the above description in the
API docs matters me)
> 
> Thanks in advance!
> 
> [1] https://curator.apache.org/apidocs/org/apache/curator/framework/recipes/cache/PathChildrenCache.html
<https://curator.apache.org/apidocs/org/apache/curator/framework/recipes/cache/PathChildrenCache.html>
> 
> Regards,
> Imesha Sudasingha
> 
> -- 
> Imesha Sudasingha
> Undergraduate of Department of Computer Science and  Engineering,
> University of Moratuwa.
> +94717086160
> View in Linkedin <https://lk.linkedin.com/in/imeshasudasingha>

Mime
View raw message