You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Ben Bangert <be...@groovie.org> on 2012/09/09 18:10:10 UTC

Data vs. Exists Watches

I'm a bit curious about some of the implementation details for exists and data watches. In the Jute files, C client, and Java client, watches are divided into:
- Data watches
- Exists watches
- Children watches

Yet the code treats data and exists watches identically, calling them at the same time. Which makes sense of course given this is in the Zookeeper Programmers manual:
"It helps to think of ZooKeeper as maintaining two lists of watches: data watches and child watches. getData() and exists() set data watches. getChildren() sets child watches."

So why do the implementations treat data and exists watches identically, but store them in two different spots? Why do the Jute files differentiate? Is this to handle some possible future difference between the two?

Cheers,
Ben