desaikomal commented on code in PR #2199:
URL: https://github.com/apache/helix/pull/2199#discussion_r951773009
##########
helix-core/src/main/java/org/apache/helix/common/caches/BasicClusterDataCache.java:
##########
@@ -217,6 +218,23 @@ public void requireFullRefresh() {
}
}
+ /**
+ * Update cache and return true if any local data is changed compared to
before refresh.
+ * @param dataAccessor the data accessor used to fetch data.
+ * @return true if there is a change to local cache.
+ */
+ public boolean updateCache(HelixDataAccessor dataAccessor) {
+ Map<String, LiveInstance> liveInstance = new HashMap<>(getLiveInstances());
+ Map<String, ExternalView> externalView = new HashMap<>(getExternalViews());
+ Map<String, InstanceConfig> instanceConfig = new
HashMap<>(getInstanceConfigMap());
+ requireFullRefresh();
+ refresh(dataAccessor);
+
+ return !(liveInstance.equals(getLiveInstances())
Review Comment:
but snapshot is taken just few cpu cycles before on line-227
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]