desaijay230592 commented on a change in pull request #6842: URL: https://github.com/apache/incubator-pinot/pull/6842#discussion_r626956411
########## File path: pinot-server/src/main/java/org/apache/pinot/server/starter/helix/HelixServerStarter.java ########## @@ -321,6 +357,16 @@ public void start() LOGGER.info("Initializing server instance and registering state model factory"); Utils.logVersions(); ControllerLeaderLocator.create(_helixManager); + + // Invoke pinot environment provider factory's init method to register the environment provider + // and fetch the overridden server configs for the invoked environment provider + if (!skipPinotEnvironmentProviderFactoryInit) { + PinotEnvironmentProviderFactory.init(_serverConf.subset(PREFIX_OF_CONFIG_OF_ENVIRONMENT_PROVIDER_FACTORY)); + PinotEnvironmentProvider pinotEnvironmentProvider = PinotEnvironmentProviderFactory.getEnvironmentProvider( + _serverConf.getProperty(CONFIG_OF_ENVIRONMENT_PROVIDER_TYPE)); + _overriddenServerConfigs = pinotEnvironmentProvider.getEnvironment(_serverConf.toMap()); Review comment: Done. ########## File path: pinot-server/src/main/java/org/apache/pinot/server/starter/helix/HelixServerStarter.java ########## @@ -117,13 +125,18 @@ private AdminApiApplication _adminApiApplication; private ServerQueriesDisabledTracker _serverQueriesDisabledTracker; private RealtimeLuceneIndexRefreshState _realtimeLuceneIndexRefreshState; + private boolean skipPinotEnvironmentProviderFactoryInit = true; - public HelixServerStarter(String helixClusterName, String zkAddress, PinotConfiguration serverConf) - throws Exception { + public HelixServerStarter(String helixClusterName, String zkAddress, PinotConfiguration serverConf) throws Exception { _helixClusterName = helixClusterName; _zkAddress = zkAddress; // Make a clone so that changes to the config won't propagate to the caller _serverConf = serverConf.clone(); + // Check if PinotEnvironmentProviderFactoryInit is enabled or not + if (_serverConf.containsKey(CONFIG_OF_ENABLE_ENVIRONMENT_PROVIDER_FACTORY) && + TRUE.equals(serverConf.getProperty(CONFIG_OF_ENABLE_ENVIRONMENT_PROVIDER_FACTORY))) { + skipPinotEnvironmentProviderFactoryInit = false; + } Review comment: Done. -- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org