accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [1/2] git commit: ACCUMULO-1605 avoid recursion in Span#traceId
Date Wed, 24 Jul 2013 16:30:02 GMT
Updated Branches:
  refs/heads/1.5.1-SNAPSHOT a7bc9375b -> 44dfbf91a


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/b978900b
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/b978900b
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/b978900b

Branch: refs/heads/1.5.1-SNAPSHOT
Commit: b978900ba7361db6cb021be380632fa3d1611a19
Parents: 35c7591
Author: Eric Newton <ecn@apache.org>
Authored: Wed Jul 24 12:29:26 2013 -0400
Committer: Eric Newton <ecn@apache.org>
Committed: Wed Jul 24 12:29:26 2013 -0400

----------------------------------------------------------------------
 .../apache/accumulo/trace/instrument/impl/MilliSpan.java  | 10 +++++-----
 .../accumulo/trace/instrument/impl/RootMilliSpan.java     |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/b978900b/trace/src/main/java/org/apache/accumulo/trace/instrument/impl/MilliSpan.java
----------------------------------------------------------------------
diff --git a/trace/src/main/java/org/apache/accumulo/trace/instrument/impl/MilliSpan.java
b/trace/src/main/java/org/apache/accumulo/trace/instrument/impl/MilliSpan.java
index 8f020f0..b641a2c 100644
--- a/trace/src/main/java/org/apache/accumulo/trace/instrument/impl/MilliSpan.java
+++ b/trace/src/main/java/org/apache/accumulo/trace/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,9 +112,7 @@ public class MilliSpan implements Span {
   
   @Override
   public long traceId() {
-    if (parent == this)
-      throw new RuntimeException("loop found in trace!");
-    return parent.traceId();
+    return traceId;
   }
   
   @Override

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b978900b/trace/src/main/java/org/apache/accumulo/trace/instrument/impl/RootMilliSpan.java
----------------------------------------------------------------------
diff --git a/trace/src/main/java/org/apache/accumulo/trace/instrument/impl/RootMilliSpan.java
b/trace/src/main/java/org/apache/accumulo/trace/instrument/impl/RootMilliSpan.java
index eb31dcc..c25e644 100644
--- a/trace/src/main/java/org/apache/accumulo/trace/instrument/impl/RootMilliSpan.java
+++ b/trace/src/main/java/org/apache/accumulo/trace/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