Search in sources :

Example 6 with IntBooleanIntBooleanValue

use of com.navercorp.pinpoint.common.util.IntBooleanIntBooleanValue 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 7 with IntBooleanIntBooleanValue

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

the class AnnotationTranscoder method encodeIntBooleanIntBooleanValue.

private byte[] encodeIntBooleanIntBooleanValue(Object o) {
    final IntBooleanIntBooleanValue value = (IntBooleanIntBooleanValue) o;
    // int + int
    final Buffer buffer = new AutomaticBuffer(8);
    buffer.putVInt(value.getIntValue1());
    buffer.putBoolean(value.isBooleanValue1());
    buffer.putVInt(value.getIntValue2());
    buffer.putBoolean(value.isBooleanValue2());
    return buffer.getBuffer();
}
Also used : FixedBuffer(com.navercorp.pinpoint.common.buffer.FixedBuffer) Buffer(com.navercorp.pinpoint.common.buffer.Buffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) IntBooleanIntBooleanValue(com.navercorp.pinpoint.common.util.IntBooleanIntBooleanValue) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer)

Example 8 with IntBooleanIntBooleanValue

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

the class AnnotationTranscoderTest method testIntBooleanIntBoolean.

@Test
public void testIntBooleanIntBoolean() {
    AnnotationTranscoder transcoder = new AnnotationTranscoder();
    IntBooleanIntBooleanValue value = new IntBooleanIntBooleanValue(10, false, 5000, true);
    byte[] encode = transcoder.encode(value, AnnotationTranscoder.CODE_INT_BOOLEAN_INT_BOOLEAN);
    IntBooleanIntBooleanValue decode = (IntBooleanIntBooleanValue) transcoder.decode(AnnotationTranscoder.CODE_INT_BOOLEAN_INT_BOOLEAN, encode);
    Assert.assertEquals(value.getIntValue1(), decode.getIntValue1());
    Assert.assertEquals(false, decode.isBooleanValue1());
    Assert.assertEquals(value.getIntValue2(), decode.getIntValue2());
    Assert.assertEquals(true, decode.isBooleanValue2());
}
Also used : IntBooleanIntBooleanValue(com.navercorp.pinpoint.common.util.IntBooleanIntBooleanValue) Test(org.junit.Test)

Example 9 with IntBooleanIntBooleanValue

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

the class JedisMethodInterceptor method recordIo.

private void recordIo(SpanEventRecorder recorder, CommandContext callContext) {
    if (io) {
        IntBooleanIntBooleanValue value = new IntBooleanIntBooleanValue((int) callContext.getWriteElapsedTime(), callContext.isWriteFail(), (int) callContext.getReadElapsedTime(), callContext.isReadFail());
        recorder.recordAttribute(AnnotationKey.REDIS_IO, value);
    }
}
Also used : IntBooleanIntBooleanValue(com.navercorp.pinpoint.common.util.IntBooleanIntBooleanValue)

Aggregations

IntBooleanIntBooleanValue (com.navercorp.pinpoint.common.util.IntBooleanIntBooleanValue)9 PIntBooleanIntBooleanValue (com.navercorp.pinpoint.grpc.trace.PIntBooleanIntBooleanValue)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 IntStringStringValue (com.navercorp.pinpoint.common.util.IntStringStringValue)2 IntStringValue (com.navercorp.pinpoint.common.util.IntStringValue)2 LongIntIntByteByteStringValue (com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue)2 StringStringValue (com.navercorp.pinpoint.common.util.StringStringValue)2 PAnnotationValue (com.navercorp.pinpoint.grpc.trace.PAnnotationValue)2 PIntStringStringValue (com.navercorp.pinpoint.grpc.trace.PIntStringStringValue)2 PIntStringValue (com.navercorp.pinpoint.grpc.trace.PIntStringValue)2 PLongIntIntByteByteStringValue (com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue)2 PStringStringValue (com.navercorp.pinpoint.grpc.trace.PStringStringValue)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