You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@htrace.apache.org by cm...@apache.org on 2015/01/07 20:45:17 UTC

incubator-htrace git commit: HTRACE-57. Fix LocalFileSpanReceiver to avoid adding irrelevant wrapper object (cmccabe)

Repository: incubator-htrace
Updated Branches:
  refs/heads/master 1fd01ef40 -> 3eec57c0d


HTRACE-57. Fix LocalFileSpanReceiver to avoid adding irrelevant wrapper object (cmccabe)


Project: http://git-wip-us.apache.org/repos/asf/incubator-htrace/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-htrace/commit/3eec57c0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-htrace/tree/3eec57c0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-htrace/diff/3eec57c0

Branch: refs/heads/master
Commit: 3eec57c0d3dd99aaa068df7dbc5f65082efc4dec
Parents: 1fd01ef
Author: Colin P. Mccabe <cm...@apache.org>
Authored: Wed Jan 7 08:32:58 2015 -0800
Committer: Colin P. Mccabe <cm...@apache.org>
Committed: Wed Jan 7 11:45:11 2015 -0800

----------------------------------------------------------------------
 .../org/apache/htrace/impl/LocalFileSpanReceiver.java   |  3 ++-
 .../src/main/java/org/apache/htrace/impl/MilliSpan.java | 12 ++++++------
 .../apache/htrace/impl/TestLocalFileSpanReceiver.java   |  1 -
 3 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/3eec57c0/htrace-core/src/main/java/org/apache/htrace/impl/LocalFileSpanReceiver.java
----------------------------------------------------------------------
diff --git a/htrace-core/src/main/java/org/apache/htrace/impl/LocalFileSpanReceiver.java b/htrace-core/src/main/java/org/apache/htrace/impl/LocalFileSpanReceiver.java
index 09cbb01..7fe039f 100644
--- a/htrace-core/src/main/java/org/apache/htrace/impl/LocalFileSpanReceiver.java
+++ b/htrace-core/src/main/java/org/apache/htrace/impl/LocalFileSpanReceiver.java
@@ -29,6 +29,7 @@ import java.io.BufferedWriter;
 import java.io.EOFException;
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.FileOutputStream;
 import java.io.FileWriter;
 import java.io.InputStreamReader;
 import java.io.IOException;
@@ -99,7 +100,7 @@ public class LocalFileSpanReceiver implements SpanReceiver {
     @Override
     public void run() {
       try {
-        JSON_WRITER.writeValue(writer, this);
+        JSON_WRITER.writeValue(writer, span);
         writer.write("%n");
       } catch (IOException e) {
         LOG.error("Error when writing to file: " + file, e);

http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/3eec57c0/htrace-core/src/main/java/org/apache/htrace/impl/MilliSpan.java
----------------------------------------------------------------------
diff --git a/htrace-core/src/main/java/org/apache/htrace/impl/MilliSpan.java b/htrace-core/src/main/java/org/apache/htrace/impl/MilliSpan.java
index b34df64..be5521a 100644
--- a/htrace-core/src/main/java/org/apache/htrace/impl/MilliSpan.java
+++ b/htrace-core/src/main/java/org/apache/htrace/impl/MilliSpan.java
@@ -305,12 +305,12 @@ public class MilliSpan implements Span {
           throws IOException, JsonProcessingException {
       JsonNode root = jp.getCodec().readTree(jp);
       Builder builder = new Builder();
-      builder.begin(root.get("b").asLong()).
-              end(root.get("e").asLong()).
-              description(root.get("d").asText()).
-              traceId(parseUnsignedHexLong(root.get("i").asText())).
-              spanId(parseUnsignedHexLong(root.get("s").asText())).
-              processId(root.get("r").asText());
+      builder.begin(root.get("b").asLong());
+      builder.end(root.get("e").asLong());
+      builder.description(root.get("d").asText());
+      builder.traceId(parseUnsignedHexLong(root.get("i").asText()));
+      builder.spanId(parseUnsignedHexLong(root.get("s").asText()));
+      builder.processId(root.get("r").asText());
       JsonNode parentsNode = root.get("p");
       LinkedList<Long> parents = new LinkedList<Long>();
       for (Iterator<JsonNode> iter = parentsNode.elements();

http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/3eec57c0/htrace-core/src/test/java/org/apache/htrace/impl/TestLocalFileSpanReceiver.java
----------------------------------------------------------------------
diff --git a/htrace-core/src/test/java/org/apache/htrace/impl/TestLocalFileSpanReceiver.java b/htrace-core/src/test/java/org/apache/htrace/impl/TestLocalFileSpanReceiver.java
index 98dd951..60b5430 100644
--- a/htrace-core/src/test/java/org/apache/htrace/impl/TestLocalFileSpanReceiver.java
+++ b/htrace-core/src/test/java/org/apache/htrace/impl/TestLocalFileSpanReceiver.java
@@ -33,7 +33,6 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertEquals;
 
-@Ignore
 public class TestLocalFileSpanReceiver {
   @Test
   public void testUniqueLocalTraceFileName() {