hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kih...@apache.org
Subject hadoop git commit: HDFS-7963. Fix expected tracing spans in TestTracing. Contributed by Masatake Iwasaki.
Date Thu, 26 Mar 2015 13:46:39 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 c33ecd83e -> 071277b9c


HDFS-7963. Fix expected tracing spans in TestTracing. Contributed by Masatake Iwasaki.


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

Branch: refs/heads/branch-2
Commit: 071277b9cece8da9d891f525c4dd659f2a4949dd
Parents: c33ecd8
Author: Kihwal Lee <kihwal@apache.org>
Authored: Thu Mar 26 08:42:45 2015 -0500
Committer: Kihwal Lee <kihwal@apache.org>
Committed: Thu Mar 26 08:42:45 2015 -0500

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt     |  3 +++
 .../org/apache/hadoop/tracing/TestTracing.java  | 28 ++++++++++++++++----
 2 files changed, 26 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/071277b9/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 6791d88..0c1640d 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -973,6 +973,9 @@ Release 2.7.0 - UNRELEASED
 
     HDFS-7977. NFS couldn't take percentile intervals (brandonli)
 
+    HDFS-7963. Fix expected tracing spans in TestTracing along with HDFS-7054.
+    (Masatake Iwasaki via kihwal)
+
     BREAKDOWN OF HDFS-7584 SUBTASKS AND RELATED JIRAS
 
       HDFS-7720. Quota by Storage Type API, tools and ClientNameNode

http://git-wip-us.apache.org/repos/asf/hadoop/blob/071277b9/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTracing.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTracing.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTracing.java
index 0bbd5b4..3720abe 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTracing.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTracing.java
@@ -88,7 +88,10 @@ public class TestTracing {
       "ClientNamenodeProtocol#fsync",
       "org.apache.hadoop.hdfs.protocol.ClientProtocol.complete",
       "ClientNamenodeProtocol#complete",
-      "DFSOutputStream",
+      "newStreamForCreate",
+      "DFSOutputStream#writeChunk",
+      "DFSOutputStream#close",
+      "dataStreamer",
       "OpWriteBlockProto",
       "org.apache.hadoop.hdfs.protocol.ClientProtocol.addBlock",
       "ClientNamenodeProtocol#addBlock"
@@ -102,10 +105,25 @@ public class TestTracing {
     long spanStart = s.getStartTimeMillis();
     long spanEnd = s.getStopTimeMillis();
 
-    // There should only be one trace id as it should all be homed in the
-    // top trace.
-    for (Span span : SetSpanReceiver.SetHolder.spans.values()) {
-      Assert.assertEquals(ts.getSpan().getTraceId(), span.getTraceId());
+    // Spans homed in the top trace shoud have same trace id.
+    // Spans having multiple parents (e.g. "dataStreamer" added by HDFS-7054)
+    // and children of them are exception.
+    String[] spansInTopTrace = {
+      "testWriteTraceHooks",
+      "org.apache.hadoop.hdfs.protocol.ClientProtocol.create",
+      "ClientNamenodeProtocol#create",
+      "org.apache.hadoop.hdfs.protocol.ClientProtocol.fsync",
+      "ClientNamenodeProtocol#fsync",
+      "org.apache.hadoop.hdfs.protocol.ClientProtocol.complete",
+      "ClientNamenodeProtocol#complete",
+      "newStreamForCreate",
+      "DFSOutputStream#writeChunk",
+      "DFSOutputStream#close",
+    };
+    for (String desc : spansInTopTrace) {
+      for (Span span : map.get(desc)) {
+        Assert.assertEquals(ts.getSpan().getTraceId(), span.getTraceId());
+      }
     }
   }
 


Mime
View raw message