use of com.navercorp.pinpoint.common.server.bo.AnnotationBo in project pinpoint by naver.
the class SpanDecoderV0 method readFirstAnnotationBo.
private AnnotationBo readFirstAnnotationBo(Buffer buffer) {
final int key = buffer.readSVInt();
byte valueType = buffer.readByte();
byte[] valueBytes = buffer.readPrefixedBytes();
Object value = transcoder.decode(valueType, valueBytes);
AnnotationBo current = new AnnotationBo(key, value);
return current;
}
use of com.navercorp.pinpoint.common.server.bo.AnnotationBo in project pinpoint by naver.
the class SpanDecoderV0 method readSpanValue.
public void readSpanValue(Buffer buffer, SpanBo span, SpanDecodingContext decodingContext) {
final byte version = buffer.readByte();
span.setVersion(version);
final SpanBitFiled bitFiled = new SpanBitFiled(buffer.readByte());
final short serviceType = buffer.readShort();
span.setServiceType(serviceType);
switch(bitFiled.getApplicationServiceTypeEncodingStrategy()) {
case PREV_EQUALS:
span.setApplicationServiceType(serviceType);
break;
case RAW:
span.setApplicationServiceType(buffer.readShort());
break;
default:
throw new IllegalStateException("applicationServiceType");
}
if (!bitFiled.isRoot()) {
span.setParentSpanId(buffer.readLong());
} else {
span.setParentSpanId(-1);
}
final long startTimeDelta = buffer.readVLong();
final long startTime = span.getCollectorAcceptTime() - startTimeDelta;
span.setStartTime(startTime);
span.setElapsed(buffer.readVInt());
span.setRpc(buffer.readPrefixedString());
span.setEndPoint(buffer.readPrefixedString());
span.setRemoteAddr(buffer.readPrefixedString());
span.setApiId(buffer.readSVInt());
if (bitFiled.isSetErrorCode()) {
span.setErrCode(buffer.readInt());
}
if (bitFiled.isSetHasException()) {
int exceptionId = buffer.readSVInt();
String exceptionMessage = buffer.readPrefixedString();
span.setExceptionInfo(exceptionId, exceptionMessage);
}
if (bitFiled.isSetFlag()) {
span.setFlag(buffer.readShort());
}
if (bitFiled.isSetLoggingTransactionInfo()) {
span.setLoggingTransactionInfo(buffer.readByte());
}
span.setAcceptorHost(buffer.readPrefixedString());
if (bitFiled.isSetAnnotation()) {
List<AnnotationBo> annotationBoList = readAnnotationList(buffer, decodingContext);
span.setAnnotationBoList(annotationBoList);
}
List<SpanEventBo> spanEventBoList = readSpanEvent(buffer, decodingContext, SEQUENCE_SPAN_EVENT_FILTER);
span.addSpanEventBoList(spanEventBoList);
}
use of com.navercorp.pinpoint.common.server.bo.AnnotationBo in project pinpoint by naver.
the class GrpcSpanBinder method newAnnotationBo.
private AnnotationBo newAnnotationBo(PAnnotation pAnnotation) {
Objects.requireNonNull(pAnnotation, "pAnnotation");
AnnotationBo annotationBo = annotationFactory.buildAnnotation(pAnnotation);
return annotationBo;
}
use of com.navercorp.pinpoint.common.server.bo.AnnotationBo in project pinpoint by naver.
the class GrpcSpanBinder method buildAnnotationList.
private List<AnnotationBo> buildAnnotationList(List<PAnnotation> pAnnotationList) {
if (CollectionUtils.isEmpty(pAnnotationList)) {
return Collections.emptyList();
}
List<AnnotationBo> boList = new ArrayList<>(pAnnotationList.size());
for (PAnnotation tAnnotation : pAnnotationList) {
final AnnotationBo annotationBo = newAnnotationBo(tAnnotation);
boList.add(annotationBo);
}
boList.sort(AnnotationComparator.INSTANCE);
return boList;
}
use of com.navercorp.pinpoint.common.server.bo.AnnotationBo in project pinpoint by naver.
the class AnnotationUtilsTest method findApiAnnotation_invalidType.
@Test
public void findApiAnnotation_invalidType() {
AnnotationBo annotationBo = new AnnotationBo(AnnotationKey.API.getCode(), 1);
String value = AnnotationUtils.findApiAnnotation(Collections.singletonList(annotationBo));
Assert.assertNull(null, value);
}
Aggregations