Marcosrico commented on code in PR #2619:
URL: https://github.com/apache/helix/pull/2619#discussion_r1337827328


##########
meta-client/src/main/java/org/apache/helix/metaclient/impl/zk/ZkMetaClientCache.java:
##########
@@ -43,11 +44,10 @@ public class ZkMetaClientCache<T> extends ZkMetaClient<T> 
implements MetaClientC
     private ChildChangeListener _eventListener;
     private boolean _cacheData;
     private boolean _cacheChildren;
-    private boolean _lazyCaching;
     private static final Logger LOG = 
LoggerFactory.getLogger(ZkMetaClientCache.class);
     private  ZkClient _cacheClient;
-
     private ExecutorService executor;
+    private final CountDownLatch latch = new CountDownLatch(1);

Review Comment:
   Will address latch in future pr to use conditional variable!



##########
meta-client/src/main/java/org/apache/helix/metaclient/impl/zk/ZkMetaClientCache.java:
##########
@@ -70,10 +69,16 @@ public ZkMetaClientCache(ZkMetaClientConfig config, 
MetaClientCacheConfig cacheC
         }
     }
 
+    /**
+     * Get data for a given key.
+     * If datacache is enabled, will fetch for cache. If it doesn't exist
+     * returns null (for when initial populating cache is in progress).
+     * @param key key to identify the entry
+     * @return data for the key
+     */
     @Override
     public T get(final String key) {
         if (_cacheData) {
-            getDataCacheMap().computeIfAbsent(key, k -> 
_cacheClient.readData(k, true));
             return getDataCacheMap().get(key);

Review Comment:
   I am not too sure how to do this without pinging zookeeper. If it's not 
populated yet how do we know if it doesn't actually exist in zookeeper or it's 
being populated without checking zk? 



-- 
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]

Reply via email to