Github user Randgalt commented on a diff in the pull request:
https://github.com/apache/curator/pull/202#discussion_r105545481
--- Diff:
curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java
---
@@ -694,14 +695,23 @@ private void applyNewData(String fullPath, int
resultCode, Stat stat, byte[] byt
{
offerOperation(new EventOperation(this, new
PathChildrenCacheEvent(PathChildrenCacheEvent.Type.CHILD_ADDED, data)));
}
- else if ( previousData.getStat().getVersion() !=
stat.getVersion() )
+ else if ( hasChanged(stat, previousData, data) )
{
offerOperation(new EventOperation(this, new
PathChildrenCacheEvent(PathChildrenCacheEvent.Type.CHILD_UPDATED, data)));
}
updateInitialSet(ZKPaths.getNodeFromPath(fullPath), data);
}
}
+ private boolean hasChanged(Stat stat, ChildData previousData,
ChildData newData)
+ {
+ if ( cacheData )
+ {
+ return !Arrays.equals(previousData.getData(),
newData.getData());
--- End diff --
It's not possible to do anything else. The only data we have is the version
and the data itself. As a general rule, it's not possible to get every event in
ZooKeeper.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---