Browse Source

MAPREDUCE-2855. Passing a cached class-loader to ResourceBundle creator to minimize counter names lookup time. Contributed by Siddarth Seth.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1294436 13f79535-47bb-0310-9956-ffa450edef68
Vinod Kumar Vavilapalli 13 years ago
parent
commit
165cd626c5

+ 3 - 0
hadoop-mapreduce-project/CHANGES.txt

@@ -141,6 +141,9 @@ Release 0.23.2 - UNRELEASED
     MAPREDUCE-3901. Modified JobHistory records in YARN to lazily load job and
     task reports so as to improve UI response times. (Siddarth Seth via vinodkv)
 
+    MAPREDUCE-2855. Passing a cached class-loader to ResourceBundle creator to
+    minimize counter names lookup time. (Siddarth Seth via vinodkv)
+
   BUG FIXES
     MAPREDUCE-3918  proc_historyserver no longer in command line arguments for
     HistoryServer (Jon Eagles via bobby)

+ 3 - 1
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/util/ResourceBundles.java

@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.mapreduce.util;
 
+import java.util.Locale;
 import java.util.ResourceBundle;
 import java.util.MissingResourceException;
 
@@ -33,7 +34,8 @@ public class ResourceBundles {
    * @throws MissingResourceException
    */
   public static ResourceBundle getBundle(String bundleName) {
-    return ResourceBundle.getBundle(bundleName.replace('$', '_'));
+    return ResourceBundle.getBundle(bundleName.replace('$', '_'),
+        Locale.getDefault(), Thread.currentThread().getContextClassLoader());
   }
 
   /**