hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmcc...@apache.org
Subject hadoop git commit: HADOOP-11912. Extra configuration key used in TraceUtils should respect prefix (Masatake Iwasaki via Colin P. McCabe)
Date Wed, 06 May 2015 00:50:28 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 b8e450763 -> 606e4f494


HADOOP-11912. Extra configuration key used in TraceUtils should respect prefix (Masatake Iwasaki
via Colin P. McCabe)

(cherry picked from commit 90b384564875bb353224630e501772b46d4ca9c5)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/606e4f49
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/606e4f49
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/606e4f49

Branch: refs/heads/branch-2
Commit: 606e4f4940a78af96411dc72900b195831d077a6
Parents: b8e4507
Author: Colin Patrick Mccabe <cmccabe@cloudera.com>
Authored: Tue May 5 17:40:31 2015 -0700
Committer: Colin Patrick Mccabe <cmccabe@cloudera.com>
Committed: Tue May 5 17:50:04 2015 -0700

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt         |  3 +++
 .../main/java/org/apache/hadoop/tracing/TraceUtils.java | 12 +++++-------
 .../java/org/apache/hadoop/tracing/TestTraceUtils.java  |  2 +-
 3 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/606e4f49/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index 9b73647..4895c15 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -162,6 +162,9 @@ Release 2.8.0 - UNRELEASED
 
     HADOOP-11926. test-patch.sh mv does wrong math (aw)
 
+    HADOOP-11912. Extra configuration key used in TraceUtils should respect
+    prefix (Masatake Iwasaki via Colin P. McCabe)
+
 Release 2.7.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/606e4f49/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/TraceUtils.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/TraceUtils.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/TraceUtils.java
index fa52ac6..52b5d47 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/TraceUtils.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/TraceUtils.java
@@ -47,18 +47,16 @@ public class TraceUtils {
     return new HTraceConfiguration() {
       @Override
       public String get(String key) {
-        if (extraMap.containsKey(key)) {
-          return extraMap.get(key);
-        }
-        return conf.get(prefix + key, "");
+        return get(key, "");
       }
 
       @Override
       public String get(String key, String defaultValue) {
-        if (extraMap.containsKey(key)) {
-          return extraMap.get(key);
+        String prefixedKey = prefix + key;
+        if (extraMap.containsKey(prefixedKey)) {
+          return extraMap.get(prefixedKey);
         }
-        return conf.get(prefix + key, defaultValue);
+        return conf.get(prefixedKey, defaultValue);
       }
     };
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/606e4f49/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/tracing/TestTraceUtils.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/tracing/TestTraceUtils.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/tracing/TestTraceUtils.java
index 80d64b1..400d003 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/tracing/TestTraceUtils.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/tracing/TestTraceUtils.java
@@ -46,7 +46,7 @@ public class TestTraceUtils {
     conf.set(TEST_PREFIX + key, oldValue);
     LinkedList<ConfigurationPair> extraConfig =
         new LinkedList<ConfigurationPair>();
-    extraConfig.add(new ConfigurationPair(key, newValue));
+    extraConfig.add(new ConfigurationPair(TEST_PREFIX + key, newValue));
     HTraceConfiguration wrapped = TraceUtils.wrapHadoopConf(TEST_PREFIX, conf, extraConfig);
     assertEquals(newValue, wrapped.get(key));
   }


Mime
View raw message