提交 58dce9cc 编写于 作者: wu-sheng's avatar wu-sheng

Add some comments.

上级 d1ebaf93
...@@ -24,6 +24,13 @@ public abstract class DistributedTraceId { ...@@ -24,6 +24,13 @@ public abstract class DistributedTraceId {
return id; return id;
} }
/**
* Compare the two <code>DistributedTraceId</code> by its {@link #id},
* even these two <code>DistributedTraceId</code>s are not the same instances.
*
* @param o target <code>DistributedTraceId</code>
* @return return if they have the same {@link #id}
*/
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) if (this == o)
......
...@@ -100,8 +100,7 @@ public class TraceSegment { ...@@ -100,8 +100,7 @@ public class TraceSegment {
private boolean sampled; private boolean sampled;
/** /**
* Create a trace segment, by given segmentId. * Create a trace segment, by the given applicationCode.
* This segmentId is generated by TraceSegmentRef, AKA, from tracer/agent module.
*/ */
public TraceSegment(String applicationCode) { public TraceSegment(String applicationCode) {
this(); this();
...@@ -109,7 +108,9 @@ public class TraceSegment { ...@@ -109,7 +108,9 @@ public class TraceSegment {
} }
/** /**
* Create a default/empty trace segment * Create a default/empty trace segment,
* with current time as start time,
* and generate a new segment id.
*/ */
public TraceSegment() { public TraceSegment() {
this.startTime = System.currentTimeMillis(); this.startTime = System.currentTimeMillis();
...@@ -134,6 +135,11 @@ public class TraceSegment { ...@@ -134,6 +135,11 @@ public class TraceSegment {
} }
} }
/**
* Establish the line between this segment and all relative global trace ids.
*
* @param distributedTraceIds multi global trace ids. @see {@link DistributedTraceId}
*/
public void relatedGlobalTraces(List<DistributedTraceId> distributedTraceIds) { public void relatedGlobalTraces(List<DistributedTraceId> distributedTraceIds) {
if (distributedTraceIds == null || distributedTraceIds.size() == 0) { if (distributedTraceIds == null || distributedTraceIds.size() == 0) {
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册