use of com.navercorp.pinpoint.thrift.dto.TLocalAsyncId in project pinpoint by naver.
the class SpanThriftMessageConverter method buildTSpanChunk.
@VisibleForTesting
TSpanChunk buildTSpanChunk(SpanChunk spanChunk) {
final TSpanChunk tSpanChunk = new TSpanChunk();
tSpanChunk.setApplicationName(applicationName);
tSpanChunk.setAgentId(agentId);
tSpanChunk.setAgentStartTime(agentStartTime);
tSpanChunk.setApplicationServiceType(applicationServiceType);
final TraceRoot traceRoot = spanChunk.getTraceRoot();
final TraceId traceId = traceRoot.getTraceId();
final ByteBuffer transactionId = transactionIdEncoder.encodeTransactionId(traceId);
tSpanChunk.setTransactionId(transactionId);
tSpanChunk.setSpanId(traceId.getSpanId());
final Shared shared = traceRoot.getShared();
tSpanChunk.setEndPoint(shared.getEndPoint());
if (spanChunk instanceof AsyncSpanChunk) {
final AsyncSpanChunk asyncSpanChunk = (AsyncSpanChunk) spanChunk;
final LocalAsyncId localAsyncId = asyncSpanChunk.getLocalAsyncId();
final TLocalAsyncId tLocalAsyncId = new TLocalAsyncId(localAsyncId.getAsyncId(), localAsyncId.getSequence());
tSpanChunk.setLocalAsyncId(tLocalAsyncId);
}
spanPostProcessor.preProcess(spanChunk, tSpanChunk);
final List<SpanEvent> spanEventList = spanChunk.getSpanEventList();
if (CollectionUtils.hasLength(spanEventList)) {
final List<TSpanEvent> tSpanEvents = buildTSpanEventList(spanEventList);
tSpanChunk.setSpanEventList(tSpanEvents);
}
spanPostProcessor.postProcess(spanChunk, tSpanChunk);
return tSpanChunk;
}
Aggregations