[GitHub] [hadoop] jojochuang commented on a change in pull request #2436: HADOOP-17358. Improve excessive reloading of Configurations

2020-11-10 Thread GitBox


jojochuang commented on a change in pull request #2436:
URL: https://github.com/apache/hadoop/pull/2436#discussion_r520947632



##
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
##
@@ -2876,12 +2876,28 @@ public Reader getConfResourceAsReader(String name) {
   protected synchronized Properties getProps() {
 if (properties == null) {
   properties = new Properties();
-  Map backup = updatingResource != null ?
-  new ConcurrentHashMap(updatingResource) : null;
-  loadResources(properties, resources, quietmode);
+  loadProps(properties, 0, true);
+}
+return properties;
+  }
 
+  /**
+   * Loads the resource at a given index into the properties.
+   * @param props the object containing the loaded properties.
+   * @param startIdx the index where the new resource has been added.
+   * @param fullReload flag whether we do complete reload of the conf instead
+   *   of just loading the new resource.
+   * @return the properties loaded from the resource.

Review comment:
   Could you also remove this @return? I am +1 once this is updated.





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: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[GitHub] [hadoop] jojochuang commented on a change in pull request #2436: HADOOP-17358. Improve excessive reloading of Configurations

2020-11-10 Thread GitBox


jojochuang commented on a change in pull request #2436:
URL: https://github.com/apache/hadoop/pull/2436#discussion_r520727890



##
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
##
@@ -2893,7 +2909,7 @@ protected synchronized Properties getProps() {
 }
   }
 }
-return properties;
+return props;

Review comment:
   (I thought I posted a comment here, but somehow it got lost in github 
comments)
   returning this object isn't necessary, and obviously the callers don't use 
the return value.





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: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[GitHub] [hadoop] jojochuang commented on a change in pull request #2436: HADOOP-17358. Improve excessive reloading of Configurations

2020-11-05 Thread GitBox


jojochuang commented on a change in pull request #2436:
URL: https://github.com/apache/hadoop/pull/2436#discussion_r518270081



##
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
##
@@ -2876,10 +2876,17 @@ public Reader getConfResourceAsReader(String name) {
   protected synchronized Properties getProps() {
 if (properties == null) {
   properties = new Properties();
+  loadProps(properties, -1);

Review comment:
   I would really appreciate if you rewrite this so it doesn't use -1 as 
startIdx. A year from now I won't remember why we want to load from position -1.





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: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org