Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why doesn the NodeChildrenChanged and NodeDataChanged watch events return more information about the change?

events Return WATCH
0
Posted

Why doesn the NodeChildrenChanged and NodeDataChanged watch events return more information about the change?

0

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”.

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123