xyuanlu commented on code in PR #2619:
URL: https://github.com/apache/helix/pull/2619#discussion_r1333612621
##########
meta-client/src/main/java/org/apache/helix/metaclient/impl/zk/ZkMetaClientCache.java:
##########
@@ -81,14 +106,47 @@ public int countDirectChildren(final String key) {
throw new MetaClientException("Not implemented yet.");
}
- @Override
- public List<T> get(List<String> keys) {
- throw new MetaClientException("Not implemented yet.");
+ private void handleCacheUpdate(String path, ChildChangeListener.ChangeType
changeType) {
+ switch (changeType) {
+ case ENTRY_CREATED:
+ // Not implemented yet.
+ break;
+ case ENTRY_DELETED:
+ // Not implemented yet.
+ break;
+ case ENTRY_DATA_CHANGE:
+ modifyDataInCache(path);
+ break;
+ default:
+ LOG.error("Unknown change type: " + changeType);
+ }
}
- @Override
- public List<Stat> exists(List<String> keys) {
- throw new MetaClientException("Not implemented yet.");
+ private void modifyDataInCache(String path) {
+ if (_cacheData) {
+ T dataRecord = _cacheClient.readData(path, true);
Review Comment:
Call back already give you data, no need to read again.
--
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]