Jackie-Jiang commented on code in PR #14235:
URL: https://github.com/apache/pinot/pull/14235#discussion_r1806875967


##########
pinot-spi/src/main/java/org/apache/pinot/spi/env/PinotConfiguration.java:
##########
@@ -170,8 +174,18 @@ public static List<Configuration> 
applyDynamicEnvConfig(List<Configuration> conf
       Map<String, String> environmentVariables) {
     return configurations.stream().peek(configuration -> {
       for (String dynamicEnvConfigVarName : 
configuration.getStringArray(ENV_DYNAMIC_CONFIG_KEY)) {
-        configuration.setProperty(dynamicEnvConfigVarName,
-            
environmentVariables.get(configuration.getString(dynamicEnvConfigVarName)));
+        if (configuration.getProperty(TEMPLATED_KEY) == null || 
!configuration.getProperty(TEMPLATED_KEY)
+            .equals(true)) {
+          configuration.setProperty(dynamicEnvConfigVarName,
+              
environmentVariables.get(configuration.getString(dynamicEnvConfigVarName)));
+          LOGGER.info("The environment variable declared is set to the 
property {} through dynamic configs",
+              dynamicEnvConfigVarName);
+        }
+      }
+      //set template when dynamic.env.config property is declared in the config
+      if (configuration.getStringArray(ENV_DYNAMIC_CONFIG_KEY).length > 0) {

Review Comment:
   No need to check this again



##########
pinot-spi/src/main/java/org/apache/pinot/spi/env/PinotConfiguration.java:
##########
@@ -170,8 +174,18 @@ public static List<Configuration> 
applyDynamicEnvConfig(List<Configuration> conf
       Map<String, String> environmentVariables) {
     return configurations.stream().peek(configuration -> {
       for (String dynamicEnvConfigVarName : 
configuration.getStringArray(ENV_DYNAMIC_CONFIG_KEY)) {
-        configuration.setProperty(dynamicEnvConfigVarName,
-            
environmentVariables.get(configuration.getString(dynamicEnvConfigVarName)));
+        if (configuration.getProperty(TEMPLATED_KEY) == null || 
!configuration.getProperty(TEMPLATED_KEY)
+            .equals(true)) {

Review Comment:
   This check can be moved before the for loop



##########
pinot-spi/src/main/java/org/apache/pinot/spi/env/PinotConfiguration.java:
##########
@@ -170,8 +174,18 @@ public static List<Configuration> 
applyDynamicEnvConfig(List<Configuration> conf
       Map<String, String> environmentVariables) {
     return configurations.stream().peek(configuration -> {
       for (String dynamicEnvConfigVarName : 
configuration.getStringArray(ENV_DYNAMIC_CONFIG_KEY)) {
-        configuration.setProperty(dynamicEnvConfigVarName,
-            
environmentVariables.get(configuration.getString(dynamicEnvConfigVarName)));
+        if (configuration.getProperty(TEMPLATED_KEY) == null || 
!configuration.getProperty(TEMPLATED_KEY)
+            .equals(true)) {

Review Comment:
   ```suggestion
           if (configuration.getBoolean(TEMPLATED_KEY, false)) {
   ```



-- 
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: commits-unsubscr...@pinot.apache.org

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