You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pinot.apache.org by GitBox <gi...@apache.org> on 2019/01/03 01:47:27 UTC

[GitHub] dasahcc commented on a change in pull request #3633: Use ZkCacheBaseDataAccessor to cache instance configs in PinotHelixResourceManager

dasahcc commented on a change in pull request #3633: Use ZkCacheBaseDataAccessor to cache instance configs in PinotHelixResourceManager
URL: https://github.com/apache/incubator-pinot/pull/3633#discussion_r244900206
 
 

 ##########
 File path: pinot-controller/src/main/java/com/linkedin/pinot/controller/helix/core/PinotHelixResourceManager.java
 ##########
 @@ -168,6 +173,16 @@ public synchronized void start() {
     _helixAdmin = _helixZkManager.getClusterManagmentTool();
     _propertyStore = _helixZkManager.getHelixPropertyStore();
     _helixDataAccessor = _helixZkManager.getHelixDataAccessor();
+    // Cache instance zk paths.
+    BaseDataAccessor<ZNRecord> baseDataAccessor = _helixDataAccessor.getBaseDataAccessor();
+    if (baseDataAccessor instanceof ZkBaseDataAccessor) {
+      String instanceConfigs = PropertyPathBuilder.instanceConfig(_helixClusterName);
+      _cacheInstanceConfigsDataAccessor =
+          new ZkCacheBaseDataAccessor<>((ZkBaseDataAccessor<ZNRecord>) baseDataAccessor, instanceConfigs,
+              Collections.singletonList(instanceConfigs), Collections.singletonList(instanceConfigs));
 
 Review comment:
   If you already give root path. You should not put INSTANCE path again here.  Or if you know that instances are stable, which means there are no instances added or shutdown, you can directly subscribe the paths without root path.
   
   You can refer Helix ZkHelixPropertyStore or this constructor:
   
     public ZkCacheBaseDataAccessor(ZkBaseDataAccessor<T> baseAccessor, List<String> wtCachePaths) {
       this(baseAccessor, null, wtCachePaths, null);
     }

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pinot.apache.org
For additional commands, e-mail: dev-help@pinot.apache.org