You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2019/07/22 23:46:02 UTC

[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #4449: Add resource config for lead controller resource

Jackie-Jiang commented on a change in pull request #4449: Add resource config for lead controller resource
URL: https://github.com/apache/incubator-pinot/pull/4449#discussion_r306077246
 
 

 ##########
 File path: pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/util/HelixSetupUtils.java
 ##########
 @@ -177,5 +180,16 @@ private static void createLeadControllerResourceIfNeeded(String helixClusterName
 
       helixAdmin.addResource(helixClusterName, LEAD_CONTROLLER_RESOURCE_NAME, idealState);
     }
+
+    // Create resource config for lead controller resource if it doesn't exist
+    ResourceConfig resourceConfig = configAccessor.getResourceConfig(helixClusterName, LEAD_CONTROLLER_RESOURCE_NAME);
+    if (resourceConfig == null) {
+      resourceConfig = new ResourceConfig(LEAD_CONTROLLER_RESOURCE_NAME);
+    }
+    // Set RESOURCE_ENABLED to false if it's absent in resource config
+    if (resourceConfig.getSimpleConfig("RESOURCE_ENABLED") == null) {
 
 Review comment:
   putIfAbsent?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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