Search in sources :

Example 1 with PStringStringValue

use of com.navercorp.pinpoint.grpc.trace.PStringStringValue in project pinpoint by naver.

the class DataTypeAnnotation method apply.

@Override
public PAnnotationValue apply(GrpcAnnotationValueMapper context) {
    PAnnotationValue.Builder builder = context.getAnnotationBuilder();
    final DataType dataType = this.value;
    if (dataType instanceof IntStringValue) {
        final IntStringValue v = (IntStringValue) dataType;
        PIntStringValue pIntStringValue = context.newIntStringValue(v);
        builder.setIntStringValue(pIntStringValue);
        return builder.build();
    } else if (dataType instanceof StringStringValue) {
        final StringStringValue v = (StringStringValue) dataType;
        PStringStringValue pStringStringValue = context.newStringStringValue(v);
        builder.setStringStringValue(pStringStringValue);
        return builder.build();
    } else if (dataType instanceof IntStringStringValue) {
        final IntStringStringValue v = (IntStringStringValue) dataType;
        final PIntStringStringValue pIntStringStringValue = context.newIntStringStringValue(v);
        builder.setIntStringStringValue(pIntStringStringValue);
        return builder.build();
    } else if (dataType instanceof LongIntIntByteByteStringValue) {
        final LongIntIntByteByteStringValue v = (LongIntIntByteByteStringValue) dataType;
        final PLongIntIntByteByteStringValue pValue = context.newLongIntIntByteByteStringValue(v);
        builder.setLongIntIntByteByteStringValue(pValue);
        return builder.build();
    } else if (dataType instanceof IntBooleanIntBooleanValue) {
        final IntBooleanIntBooleanValue v = (IntBooleanIntBooleanValue) dataType;
        final PIntBooleanIntBooleanValue pValue = context.newIntBooleanIntBooleanValue(v);
        builder.setIntBooleanIntBooleanValue(pValue);
        return builder.build();
    }
    throw new UnsupportedOperationException("unsupported type:" + dataType);
}
Also used : PAnnotationValue(com.navercorp.pinpoint.grpc.trace.PAnnotationValue) IntBooleanIntBooleanValue(com.navercorp.pinpoint.common.util.IntBooleanIntBooleanValue) PIntBooleanIntBooleanValue(com.navercorp.pinpoint.grpc.trace.PIntBooleanIntBooleanValue) TIntBooleanIntBooleanValue(com.navercorp.pinpoint.thrift.dto.TIntBooleanIntBooleanValue) PLongIntIntByteByteStringValue(com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue) TLongIntIntByteByteStringValue(com.navercorp.pinpoint.thrift.dto.TLongIntIntByteByteStringValue) PLongIntIntByteByteStringValue(com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue) LongIntIntByteByteStringValue(com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue) PIntBooleanIntBooleanValue(com.navercorp.pinpoint.grpc.trace.PIntBooleanIntBooleanValue) PStringStringValue(com.navercorp.pinpoint.grpc.trace.PStringStringValue) PIntStringStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringStringValue) IntStringStringValue(com.navercorp.pinpoint.common.util.IntStringStringValue) PIntStringStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringStringValue) TIntStringStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringStringValue) 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) PIntStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringValue) IntStringValue(com.navercorp.pinpoint.common.util.IntStringValue) PIntStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringValue) TIntStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringValue) DataType(com.navercorp.pinpoint.common.util.DataType)

Example 2 with PStringStringValue

use of com.navercorp.pinpoint.grpc.trace.PStringStringValue in project pinpoint by naver.

the class GrpcAnnotationValueMapper method newStringStringValue.

public PStringStringValue newStringStringValue(StringStringValue v) {
    final PStringStringValue.Builder builder = this.stringStringBuilder;
    if (v.getStringValue1() != null) {
        StringValue stringValue1 = newStringValue(v.getStringValue1());
        builder.setStringValue1(stringValue1);
    }
    if (v.getStringValue2() != null) {
        StringValue stringValue2 = newStringValue(v.getStringValue2());
        builder.setStringValue2(stringValue2);
    }
    PStringStringValue value = builder.build();
    builder.clear();
    return value;
}
Also used : IntStringValue(com.navercorp.pinpoint.common.util.IntStringValue) PStringStringValue(com.navercorp.pinpoint.grpc.trace.PStringStringValue) StringStringValue(com.navercorp.pinpoint.common.util.StringStringValue) PIntStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringValue) StringValue(com.google.protobuf.StringValue) PLongIntIntByteByteStringValue(com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue) IntStringStringValue(com.navercorp.pinpoint.common.util.IntStringStringValue) PIntStringStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringStringValue) LongIntIntByteByteStringValue(com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue) PStringStringValue(com.navercorp.pinpoint.grpc.trace.PStringStringValue)

Example 3 with PStringStringValue

use of com.navercorp.pinpoint.grpc.trace.PStringStringValue in project pinpoint by naver.

the class GrpcAnnotationHandler method newStringStringValue.

private StringStringValue newStringStringValue(Object annotationValue) {
    final PStringStringValue pValue = (PStringStringValue) annotationValue;
    String stringValue1 = null;
    if (pValue.hasStringValue1()) {
        stringValue1 = pValue.getStringValue1().getValue();
    }
    String stringValue2 = null;
    if (pValue.hasStringValue2()) {
        stringValue2 = pValue.getStringValue2().getValue();
    }
    return new StringStringValue(stringValue1, stringValue2);
}
Also used : 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) PStringStringValue(com.navercorp.pinpoint.grpc.trace.PStringStringValue)

Example 4 with PStringStringValue

use of com.navercorp.pinpoint.grpc.trace.PStringStringValue in project pinpoint by naver.

the class GrpcAnnotationValueMapperTest method buildPAnnotationValue_StringString.

@Test
public void buildPAnnotationValue_StringString() {
    StringStringValue intStringValue = new StringStringValue("1", "2");
    PAnnotationValue container = mapper.buildPAnnotationValue(Annotations.of(1, intStringValue));
    PStringStringValue pAnnotation = container.getStringStringValue();
    Assert.assertEquals(pAnnotation.getStringValue1().getValue(), "1");
    Assert.assertEquals(pAnnotation.getStringValue2().getValue(), "2");
}
Also used : PAnnotationValue(com.navercorp.pinpoint.grpc.trace.PAnnotationValue) 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) PStringStringValue(com.navercorp.pinpoint.grpc.trace.PStringStringValue) Test(org.junit.Test)

Aggregations

IntStringStringValue (com.navercorp.pinpoint.common.util.IntStringStringValue)4 StringStringValue (com.navercorp.pinpoint.common.util.StringStringValue)4 PIntStringStringValue (com.navercorp.pinpoint.grpc.trace.PIntStringStringValue)4 PStringStringValue (com.navercorp.pinpoint.grpc.trace.PStringStringValue)4 IntStringValue (com.navercorp.pinpoint.common.util.IntStringValue)2 LongIntIntByteByteStringValue (com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue)2 PAnnotationValue (com.navercorp.pinpoint.grpc.trace.PAnnotationValue)2 PIntStringValue (com.navercorp.pinpoint.grpc.trace.PIntStringValue)2 PLongIntIntByteByteStringValue (com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue)2 StringValue (com.google.protobuf.StringValue)1 DataType (com.navercorp.pinpoint.common.util.DataType)1 IntBooleanIntBooleanValue (com.navercorp.pinpoint.common.util.IntBooleanIntBooleanValue)1 PIntBooleanIntBooleanValue (com.navercorp.pinpoint.grpc.trace.PIntBooleanIntBooleanValue)1 TIntBooleanIntBooleanValue (com.navercorp.pinpoint.thrift.dto.TIntBooleanIntBooleanValue)1 TIntStringStringValue (com.navercorp.pinpoint.thrift.dto.TIntStringStringValue)1 TIntStringValue (com.navercorp.pinpoint.thrift.dto.TIntStringValue)1 TLongIntIntByteByteStringValue (com.navercorp.pinpoint.thrift.dto.TLongIntIntByteByteStringValue)1 TStringStringValue (com.navercorp.pinpoint.thrift.dto.TStringStringValue)1 Test (org.junit.Test)1