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


##########
meta-client/src/main/java/org/apache/helix/metaclient/impl/zk/ZkMetaClientCache.java:
##########
@@ -81,14 +109,94 @@ 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 populateAllCache() {
+        // TODO: Concurrently populate children and data cache.
+        if (_cacheData) {
+            try {
+                List<String> children = _cacheClient.getChildren(_rootEntry);
+                for (String child : children) {
+                    String childPath = _rootEntry + "/" + child;
+                    T dataRecord = _cacheClient.readData(childPath, true);
+                    getDataCacheMap().put(childPath, dataRecord);
+                }
+            } catch (Exception e) {
+                // Ignore
+            }
+        }
     }
 
-    @Override
-    public List<Stat> exists(List<String> keys) {
-        throw new MetaClientException("Not implemented yet.");
+    private class CacheUpdateRunnable implements Runnable {
+        private final String path;
+        private final ChildChangeListener.ChangeType changeType;
+
+        public CacheUpdateRunnable(String path, ChildChangeListener.ChangeType 
changeType) {

Review Comment:
   nit: Add todo for dedup.



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