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


##########
pinot-spi/src/main/java/org/apache/pinot/spi/env/PinotConfiguration.java:
##########
@@ -356,7 +356,14 @@ public long getProperty(String name, long defaultValue) {
    * @return the property String value. Fallback to default value if missing.
    */
   public String getProperty(String name, String defaultValue) {
-    Object rawProperty = getRawProperty(name, defaultValue);
+    String relaxedPropertyName = relaxPropertyName(name);
+    if (!_configuration.containsKey(relaxedPropertyName)) {
+      return defaultValue;
+    }
+    Object rawProperty = _configuration.getProperty(relaxedPropertyName);
+    if (CommonsConfigurationUtils.needInterpolate(rawProperty)) {
+      return _configuration.getString(relaxPropertyName(name), defaultValue);

Review Comment:
   ```suggestion
         return _configuration.getString(relaxedPropertyName, defaultValue);
   ```



##########
pinot-spi/src/main/java/org/apache/pinot/spi/env/PinotConfiguration.java:
##########
@@ -372,8 +379,11 @@ private <T> T getProperty(String name, T defaultValue, 
Class<T> returnType) {
     if (!_configuration.containsKey(relaxedPropertyName)) {
       return defaultValue;
     }
-
-    return PropertyConverter.convert(getRawProperty(name, defaultValue), 
returnType);
+    Object rawProperty = _configuration.getProperty(relaxedPropertyName);
+    if (CommonsConfigurationUtils.needInterpolate(rawProperty)) {
+      return CommonsConfigurationUtils.interpolate(_configuration, 
relaxPropertyName(name), defaultValue, returnType);

Review Comment:
   ```suggestion
         return CommonsConfigurationUtils.interpolate(_configuration, 
relaxedPropertyName, defaultValue, returnType);
   ```



##########
pinot-spi/src/main/java/org/apache/pinot/spi/env/PinotConfiguration.java:
##########
@@ -356,7 +356,14 @@ public long getProperty(String name, long defaultValue) {
    * @return the property String value. Fallback to default value if missing.
    */
   public String getProperty(String name, String defaultValue) {
-    Object rawProperty = getRawProperty(name, defaultValue);
+    String relaxedPropertyName = relaxPropertyName(name);
+    if (!_configuration.containsKey(relaxedPropertyName)) {
+      return defaultValue;
+    }
+    Object rawProperty = _configuration.getProperty(relaxedPropertyName);
+    if (CommonsConfigurationUtils.needInterpolate(rawProperty)) {
+      return _configuration.getString(relaxPropertyName(name), defaultValue);
+    }
     if (rawProperty instanceof List) {
       return StringUtils.join(((ArrayList) rawProperty).toArray(), ',');

Review Comment:
   Do we need to interpolate here? Or do we need to handle List when reading 
string?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to