Marcosrico commented on code in PR #2619:
URL: https://github.com/apache/helix/pull/2619#discussion_r1332398074
##########
meta-client/src/main/java/org/apache/helix/metaclient/impl/zk/ZkMetaClientCache.java:
##########
@@ -59,16 +57,51 @@ public ZkMetaClientCache(ZkMetaClientConfig config,
MetaClientCacheConfig cacheC
_lazyCaching = cacheConfig.getLazyCaching();
_cacheData = cacheConfig.getCacheData();
_cacheChildren = cacheConfig.getCacheChildren();
+
+ if (_cacheData) {
+ _dataCacheMap = new ConcurrentHashMap<>();
+ }
+ if (_cacheChildren) {
+ _childrenCacheTree = new TrieNode(_rootEntry, null);
+ }
}
@Override
- public Stat exists(String key) {
- throw new MetaClientException("Not implemented yet.");
+ public T get(final String key) {
+ if (_cacheData) {
+ if (!getDataCacheMap().containsKey(key)) {
+ T data = _cacheClient.readData(key, true);
Review Comment:
Good point - thanks!
--
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]