hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmcc...@apache.org
Subject git commit: HDFS-7202. Should be able to omit package name of SpanReceiver on "hadoop trace -add" (iwasakims via cmccabe)
Date Thu, 09 Oct 2014 01:01:07 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk df3becf08 -> d99623528


HDFS-7202. Should be able to omit package name of SpanReceiver on "hadoop trace -add" (iwasakims
via cmccabe)


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

Branch: refs/heads/trunk
Commit: d996235285e5047f731e3d3fc4c6e6214caa10aa
Parents: df3becf
Author: Colin Patrick Mccabe <cmccabe@cloudera.com>
Authored: Wed Oct 8 17:55:46 2014 -0700
Committer: Colin Patrick Mccabe <cmccabe@cloudera.com>
Committed: Wed Oct 8 17:55:46 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/tracing/SpanReceiverHost.java     | 8 ++++----
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt                  | 3 +++
 .../test/java/org/apache/hadoop/tracing/TestTraceAdmin.java  | 8 ++++++++
 3 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/d9962352/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/SpanReceiverHost.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/SpanReceiverHost.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/SpanReceiverHost.java
index 82f099e..13c92ac 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/SpanReceiverHost.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/SpanReceiverHost.java
@@ -137,10 +137,6 @@ public class SpanReceiverHost implements TraceAdminProtocol {
           getUniqueLocalTraceFileName());
     }
     for (String className : receiverNames) {
-      className = className.trim();
-      if (!className.contains(".")) {
-        className = "org.htrace.impl." + className;
-      }
       try {
         SpanReceiver rcvr = loadInstance(className, EMPTY);
         Trace.addReceiver(rcvr);
@@ -154,6 +150,10 @@ public class SpanReceiverHost implements TraceAdminProtocol {
 
   private synchronized SpanReceiver loadInstance(String className,
       List<ConfigurationPair> extraConfig) throws IOException {
+    className = className.trim();
+    if (!className.contains(".")) {
+      className = "org.htrace.impl." + className;
+    }
     Class<?> implClass = null;
     SpanReceiver impl;
     try {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d9962352/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 1ad59b2..e2c278e 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -373,6 +373,9 @@ Release 2.7.0 - UNRELEASED
     HDFS-7186. Document the "hadoop trace" command. (Masatake Iwasaki via Colin
     P. McCabe)
 
+    HDFS-7202. Should be able to omit package name of SpanReceiver on "hadoop
+    trace -add" (iwasakims via cmccabe)
+
   OPTIMIZATIONS
 
   BUG FIXES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d9962352/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTraceAdmin.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTraceAdmin.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTraceAdmin.java
index 455e64f..79a1f39 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTraceAdmin.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTraceAdmin.java
@@ -82,6 +82,14 @@ public class TestTraceAdmin {
               getHostPortForNN(cluster)));
       Assert.assertEquals("ret:0, [no span receivers found]\n",
           runTraceCommand(trace, "-list", "-host", getHostPortForNN(cluster)));
+      Assert.assertEquals("ret:0, Added trace span receiver 2 with " +
+          "configuration local-file-span-receiver.path = " + tracePath + "\n",
+          runTraceCommand(trace, "-add", "-host", getHostPortForNN(cluster),
+              "-class", "LocalFileSpanReceiver",
+              "-Clocal-file-span-receiver.path=" + tracePath));
+      Assert.assertEquals("ret:0, Removed trace span receiver 2\n",
+          runTraceCommand(trace, "-remove", "2", "-host",
+              getHostPortForNN(cluster)));
     } finally {
       cluster.shutdown();
       tempDir.close();


Mime
View raw message