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_r245108832
 
 

 ##########
 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:
   That should work. If possible, you can local start a test and modify the 
instance config through zooinspector to see whether it got updated at cache 
side.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to