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 2021/03/29 20:09:46 UTC

[GitHub] [incubator-pinot] jackjlli commented on a change in pull request #6725: Explicitly enable lead controller resource

jackjlli commented on a change in pull request #6725:
URL: https://github.com/apache/incubator-pinot/pull/6725#discussion_r603580279



##########
File path: pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/util/HelixSetupUtils.java
##########
@@ -205,9 +205,10 @@ private static void createLeadControllerResourceIfNeeded(String helixClusterName
     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(LEAD_CONTROLLER_RESOURCE_ENABLED_KEY) == null) {
-      resourceConfig.putSimpleConfig(LEAD_CONTROLLER_RESOURCE_ENABLED_KEY, Boolean.FALSE.toString());
+    // Explicitly set RESOURCE_ENABLED to true
+    String leadControllerResourceEnabled = resourceConfig.getSimpleConfig(LEAD_CONTROLLER_RESOURCE_ENABLED_KEY);
+    if (!Boolean.parseBoolean(leadControllerResourceEnabled)) {

Review comment:
       Yes, we should always override the config to true. The `if` statement above checks whether the config is empty or false; if that's the case, we set it to true. If the config is already true, do nothing. 
   The null check has been handled in `Boolean.parseBoolean`, thus merging the logic to one place.




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



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