Why doesn the NodeChildrenChanged and NodeDataChanged watch events return more information about the change?
When a ZooKeeper server generates the change events, it knows exactly what the change is. In our initial implementation of ZooKeeper we returned this information with the change event, but it turned out that it was impossible to use correctly. There may be a correct way to use it, but we have never seen a case of correct usage. The problem is that watches are used to find out about the latest change. (Otherwise, you would just do periodic gets.) The thing that most programmers seem to miss, when they ask for this feature, is that watches are one time triggers. Observe the following case of data change: a process does a getData on “/a” with watch set to true and gets “v1”, another process changes “/a” to “v2” and shortly there after changes “/a” to “v3”. The first process would see that “/a” was changed to “v2”, but wouldn’t know that “/a” is now “/v3”.