Github user Randgalt commented on a diff in the pull request:
https://github.com/apache/curator/pull/202#discussion_r105564270
--- 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 --
Note: TreeCache uses only Mzxid to determine if there's an update. Is that
good enough?
---
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.
---