jackjlli commented on code in PR #8820:
URL: https://github.com/apache/pinot/pull/8820#discussion_r888303458


##########
pinot-server/src/main/java/org/apache/pinot/server/starter/helix/BaseServerStarter.java:
##########
@@ -751,6 +751,21 @@ public ServerInstance getServerInstance() {
     return _serverInstance;
   }
 
+  /**
+   * Helper method to set system resource info into instance config.
+   *
+   * @param helixAdmin Helix Admin
+   * @param helixClusterName Name of Helix cluster
+   * @param instanceId Id of instance for which to set the system resource info
+   * @param systemResourceMap Map containing system resource info
+   */
+  protected void setInstanceResourceInfo(HelixAdmin helixAdmin, String 
helixClusterName, String instanceId,
+      Map<String, String> systemResourceMap) {
+    InstanceConfig instanceConfig = 
helixAdmin.getInstanceConfig(helixClusterName, instanceId);
+    
instanceConfig.getRecord().setMapField(Helix.Instance.SYSTEM_RESOURCE_INFO_KEY, 
systemResourceMap);
+    helixAdmin.setInstanceConfig(helixClusterName, instanceId, instanceConfig);

Review Comment:
   You don't need to call this setter method one more time as it'll be done at 
the end. Please refer to the other logic in the same class.



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