Search in sources :

Example 6 with LongIntIntByteByteStringValue

use of com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue in project pinpoint by naver.

the class AnnotationRecordFormatter method formatTitle.

public String formatTitle(final AnnotationKey annotationKey, final AnnotationBo annotationBo, Align align) {
    if (annotationKey.getCode() == AnnotationKey.PROXY_HTTP_HEADER.getCode()) {
        if (!(annotationBo.getValue() instanceof LongIntIntByteByteStringValue)) {
            return proxyRequestTypeRegistryService.unknown().getDisplayName();
        }
        final LongIntIntByteByteStringValue value = (LongIntIntByteByteStringValue) annotationBo.getValue();
        final ProxyRequestType type = this.proxyRequestTypeRegistryService.findByCode(value.getIntValue1());
        return type.getDisplayName(value.getStringValue());
    }
    return annotationKey.getName();
}
Also used : ProxyRequestType(com.navercorp.pinpoint.agent.plugin.proxy.common.ProxyRequestType) LongIntIntByteByteStringValue(com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue)

Example 7 with LongIntIntByteByteStringValue

use of com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue in project pinpoint by naver.

the class DataTypeAnnotation method apply.

@Override
public TAnnotationValue apply(AnnotationValueThriftMapper context) {
    final DataType dataType = this.value;
    if (dataType instanceof IntStringValue) {
        final IntStringValue v = (IntStringValue) dataType;
        final TIntStringValue tIntStringValue = new TIntStringValue(v.getIntValue());
        if (v.getStringValue() != null) {
            tIntStringValue.setStringValue(v.getStringValue());
        }
        return TAnnotationValue.intStringValue(tIntStringValue);
    } else if (dataType instanceof StringStringValue) {
        final StringStringValue v = (StringStringValue) dataType;
        final TStringStringValue tStringStringValue = new TStringStringValue(v.getStringValue1());
        if (v.getStringValue2() != null) {
            tStringStringValue.setStringValue2(v.getStringValue2());
        }
        return TAnnotationValue.stringStringValue(tStringStringValue);
    } else if (dataType instanceof IntStringStringValue) {
        final IntStringStringValue v = (IntStringStringValue) dataType;
        final TIntStringStringValue tIntStringStringValue = new TIntStringStringValue(v.getIntValue());
        if (v.getStringValue1() != null) {
            tIntStringStringValue.setStringValue1(v.getStringValue1());
        }
        if (v.getStringValue2() != null) {
            tIntStringStringValue.setStringValue2(v.getStringValue2());
        }
        return TAnnotationValue.intStringStringValue(tIntStringStringValue);
    } else if (dataType instanceof LongIntIntByteByteStringValue) {
        final LongIntIntByteByteStringValue v = (LongIntIntByteByteStringValue) dataType;
        final TLongIntIntByteByteStringValue tvalue = new TLongIntIntByteByteStringValue(v.getLongValue(), v.getIntValue1());
        if (v.getIntValue2() != -1) {
            tvalue.setIntValue2(v.getIntValue2());
        }
        if (v.getByteValue1() != -1) {
            tvalue.setByteValue1(v.getByteValue1());
        }
        if (v.getByteValue2() != -1) {
            tvalue.setByteValue2(v.getByteValue2());
        }
        if (v.getStringValue() != null) {
            tvalue.setStringValue(v.getStringValue());
        }
        return TAnnotationValue.longIntIntByteByteStringValue(tvalue);
    } else if (dataType instanceof IntBooleanIntBooleanValue) {
        final IntBooleanIntBooleanValue v = (IntBooleanIntBooleanValue) dataType;
        final TIntBooleanIntBooleanValue tvalue = new TIntBooleanIntBooleanValue(v.getIntValue1(), v.isBooleanValue1(), v.getIntValue2(), v.isBooleanValue2());
        return TAnnotationValue.intBooleanIntBooleanValue(tvalue);
    }
    throw new UnsupportedOperationException("unsupported type:" + dataType);
}
Also used : TIntStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringValue) IntStringStringValue(com.navercorp.pinpoint.common.util.IntStringStringValue) PIntStringStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringStringValue) TIntStringStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringStringValue) TLongIntIntByteByteStringValue(com.navercorp.pinpoint.thrift.dto.TLongIntIntByteByteStringValue) TStringStringValue(com.navercorp.pinpoint.thrift.dto.TStringStringValue) TIntBooleanIntBooleanValue(com.navercorp.pinpoint.thrift.dto.TIntBooleanIntBooleanValue) PStringStringValue(com.navercorp.pinpoint.grpc.trace.PStringStringValue) StringStringValue(com.navercorp.pinpoint.common.util.StringStringValue) IntStringStringValue(com.navercorp.pinpoint.common.util.IntStringStringValue) PIntStringStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringStringValue) TStringStringValue(com.navercorp.pinpoint.thrift.dto.TStringStringValue) TIntStringStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringStringValue) TIntStringStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringStringValue) IntStringValue(com.navercorp.pinpoint.common.util.IntStringValue) PIntStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringValue) TIntStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringValue) IntBooleanIntBooleanValue(com.navercorp.pinpoint.common.util.IntBooleanIntBooleanValue) PIntBooleanIntBooleanValue(com.navercorp.pinpoint.grpc.trace.PIntBooleanIntBooleanValue) TIntBooleanIntBooleanValue(com.navercorp.pinpoint.thrift.dto.TIntBooleanIntBooleanValue) DataType(com.navercorp.pinpoint.common.util.DataType) TLongIntIntByteByteStringValue(com.navercorp.pinpoint.thrift.dto.TLongIntIntByteByteStringValue) PLongIntIntByteByteStringValue(com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue) LongIntIntByteByteStringValue(com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue)

Example 8 with LongIntIntByteByteStringValue

use of com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue in project pinpoint by naver.

the class AnnotationTranscoderTest method testLongIntIntByteByteString.

private void testLongIntIntByteByteString(long longValue, int intValue1, int intValue2, byte byteValue1, byte byteValue2, String stringValue) {
    AnnotationTranscoder transcoder = new AnnotationTranscoder();
    LongIntIntByteByteStringValue value = new LongIntIntByteByteStringValue(longValue, intValue1, intValue2, byteValue1, byteValue2, stringValue);
    byte[] encode = transcoder.encode(value, AnnotationTranscoder.CODE_LONG_INT_INT_BYTE_BYTE_STRING);
    LongIntIntByteByteStringValue decode = (LongIntIntByteByteStringValue) transcoder.decode(AnnotationTranscoder.CODE_LONG_INT_INT_BYTE_BYTE_STRING, encode);
    Assert.assertEquals(value.getLongValue(), decode.getLongValue());
    Assert.assertEquals(value.getIntValue1(), decode.getIntValue1());
    Assert.assertEquals(value.getIntValue2(), decode.getIntValue2());
    Assert.assertEquals(value.getByteValue1(), decode.getByteValue1());
    Assert.assertEquals(value.getByteValue2(), decode.getByteValue2());
    Assert.assertEquals(value.getStringValue(), decode.getStringValue());
}
Also used : LongIntIntByteByteStringValue(com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue)

Example 9 with LongIntIntByteByteStringValue

use of com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue in project pinpoint by naver.

the class GrpcAnnotationHandler method newLongIntIntByteByteStringValue.

private LongIntIntByteByteStringValue newLongIntIntByteByteStringValue(Object annotationValue) {
    final PLongIntIntByteByteStringValue pValue = (PLongIntIntByteByteStringValue) annotationValue;
    String stringValue = null;
    if (pValue.hasStringValue()) {
        stringValue = pValue.getStringValue().getValue();
    }
    return new LongIntIntByteByteStringValue(pValue.getLongValue(), pValue.getIntValue1(), pValue.getIntValue2(), (byte) pValue.getByteValue1(), (byte) pValue.getByteValue2(), stringValue);
}
Also used : PLongIntIntByteByteStringValue(com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue) PLongIntIntByteByteStringValue(com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue) LongIntIntByteByteStringValue(com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue)

Aggregations

LongIntIntByteByteStringValue (com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue)9 PLongIntIntByteByteStringValue (com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue)5 IntStringStringValue (com.navercorp.pinpoint.common.util.IntStringStringValue)3 IntStringValue (com.navercorp.pinpoint.common.util.IntStringValue)3 StringStringValue (com.navercorp.pinpoint.common.util.StringStringValue)3 PIntStringStringValue (com.navercorp.pinpoint.grpc.trace.PIntStringStringValue)3 PIntStringValue (com.navercorp.pinpoint.grpc.trace.PIntStringValue)3 PStringStringValue (com.navercorp.pinpoint.grpc.trace.PStringStringValue)3 AutomaticBuffer (com.navercorp.pinpoint.common.buffer.AutomaticBuffer)2 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)2 FixedBuffer (com.navercorp.pinpoint.common.buffer.FixedBuffer)2 DataType (com.navercorp.pinpoint.common.util.DataType)2 IntBooleanIntBooleanValue (com.navercorp.pinpoint.common.util.IntBooleanIntBooleanValue)2 PAnnotationValue (com.navercorp.pinpoint.grpc.trace.PAnnotationValue)2 PIntBooleanIntBooleanValue (com.navercorp.pinpoint.grpc.trace.PIntBooleanIntBooleanValue)2 TIntBooleanIntBooleanValue (com.navercorp.pinpoint.thrift.dto.TIntBooleanIntBooleanValue)2 TIntStringStringValue (com.navercorp.pinpoint.thrift.dto.TIntStringStringValue)2 TIntStringValue (com.navercorp.pinpoint.thrift.dto.TIntStringValue)2 TLongIntIntByteByteStringValue (com.navercorp.pinpoint.thrift.dto.TLongIntIntByteByteStringValue)2 TStringStringValue (com.navercorp.pinpoint.thrift.dto.TStringStringValue)2