accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject git commit: ACCUMULO-1605 avoid recursion in Span#traceId
Date Wed, 24 Jul 2013 16:01:29 GMT
Updated Branches:
  refs/heads/1.4.4-SNAPSHOT 108c492cf -> 3e971675c


ACCUMULO-1605 avoid recursion in Span#traceId


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

Branch: refs/heads/1.4.4-SNAPSHOT
Commit: 3e971675cb20248f2d4747219e97d7e28d185e08
Parents: 108c492
Author: Eric Newton <ecn@apache.org>
Authored: Wed Jul 24 12:01:36 2013 -0400
Committer: Eric Newton <ecn@apache.org>
Committed: Wed Jul 24 12:01:36 2013 -0400

----------------------------------------------------------------------
 .../accumulo/cloudtrace/instrument/impl/MilliSpan.java       | 8 +++++---
 .../accumulo/cloudtrace/instrument/impl/RootMilliSpan.java   | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/3e971675/src/trace/src/main/java/org/apache/accumulo/cloudtrace/instrument/impl/MilliSpan.java
----------------------------------------------------------------------
diff --git a/src/trace/src/main/java/org/apache/accumulo/cloudtrace/instrument/impl/MilliSpan.java
b/src/trace/src/main/java/org/apache/accumulo/cloudtrace/instrument/impl/MilliSpan.java
index 4af31d2..34a83ff 100644
--- a/src/trace/src/main/java/org/apache/accumulo/cloudtrace/instrument/impl/MilliSpan.java
+++ b/src/trace/src/main/java/org/apache/accumulo/cloudtrace/instrument/impl/MilliSpan.java
@@ -37,15 +37,17 @@ public class MilliSpan implements Span {
   final private Span parent;
   final private String description;
   final private long spanId;
+  final private long traceId;
   private Map<String,String> traceInfo = null;
   
   public Span child(String description) {
-    return new MilliSpan(description, next.nextLong(), this);
+    return new MilliSpan(description, next.nextLong(), traceId, this);
   }
   
-  public MilliSpan(String description, long id, Span parent) {
+  public MilliSpan(String description, long id, long traceId, Span parent) {
     this.description = description;
     this.spanId = id;
+    this.traceId = traceId;
     this.parent = parent;
     this.start = 0;
     this.stop = 0;
@@ -110,7 +112,7 @@ public class MilliSpan implements Span {
   
   @Override
   public long traceId() {
-    return parent.traceId();
+    return traceId;
   }
   
   @Override

http://git-wip-us.apache.org/repos/asf/accumulo/blob/3e971675/src/trace/src/main/java/org/apache/accumulo/cloudtrace/instrument/impl/RootMilliSpan.java
----------------------------------------------------------------------
diff --git a/src/trace/src/main/java/org/apache/accumulo/cloudtrace/instrument/impl/RootMilliSpan.java
b/src/trace/src/main/java/org/apache/accumulo/cloudtrace/instrument/impl/RootMilliSpan.java
index dc0e0b6..d531e6d 100644
--- a/src/trace/src/main/java/org/apache/accumulo/cloudtrace/instrument/impl/RootMilliSpan.java
+++ b/src/trace/src/main/java/org/apache/accumulo/cloudtrace/instrument/impl/RootMilliSpan.java
@@ -31,7 +31,7 @@ public class RootMilliSpan extends MilliSpan {
   }
   
   public RootMilliSpan(String description, long traceId, long spanId, long parentId) {
-    super(description, spanId, null);
+    super(description, spanId, traceId, null);
     this.traceId = traceId;
     this.parentId = parentId;
   }


Mime
View raw message