desaijay230592 commented on a change in pull request #6842:
URL: https://github.com/apache/incubator-pinot/pull/6842#discussion_r628396786



##########
File path: 
pinot-server/src/main/java/org/apache/pinot/server/starter/helix/HelixServerStarter.java
##########
@@ -261,12 +270,39 @@ private void updateInstanceConfigIfNeeded(String host, 
int port) {
         "Failed to update instance config");
   }
 
+  // Fetch the overridden server configs for the invoked environment provider
+  private void populateFailureDomain() {
+    String className = 
_serverConf.getProperty(ENVIRONMENT_PROVIDER_CLASS_NAME);
+    if (className == null) return;
+    PinotEnvironmentProvider pinotEnvironmentProvider = 
PinotEnvironmentProviderFactory.getEnvironmentProvider(className.toLowerCase());
+    _serverConf = pinotEnvironmentProvider.getEnvironment(_serverConf.toMap());
+    Map<String, Object> overriddenPinotConfigurationMap = _serverConf.toMap();
+    String failureDomain = 
overriddenPinotConfigurationMap.containsKey(INSTANCE_FAILURE_DOMAIN.toLowerCase())
 ?
+        
String.valueOf(overriddenPinotConfigurationMap.get(INSTANCE_FAILURE_DOMAIN.toLowerCase()))
 : null;
+    if (failureDomain == null) {
+      LOGGER.info("No failure domain information found for instance: {}", 
_instanceId);
+      return;
+    }
+    Map<String, String> failureDomainMap = new HashMap<>();
+    failureDomainMap.put(FAILURE_DOMAIN_IDENTIFIER, failureDomain);

Review comment:
       If u see we provide entire serverConfig map to getEnvironment() function 
wherein we add the fault domain property and return the entire config map. 
Putting all environment fields in the map is equivalent to storing all server 
config properties under mapFields which is not the intention here. Hence, we 
cherry-pick the Failure Domain information and only populate that in the 
mapFields. Yes, if going forward we want to populate more use-case specific 
environment properties we need to make some customizations. 




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

Reply via email to