use of com.navercorp.pinpoint.thrift.dto.TIntStringStringValue in project pinpoint by naver.
the class AnnotationTranscoder method encodeIntStringStringValue.
private byte[] encodeIntStringStringValue(Object o) {
final TIntStringStringValue tIntStringStringValue = (TIntStringStringValue) o;
final int intValue = tIntStringStringValue.getIntValue();
final byte[] stringValue1 = BytesUtils.toBytes(tIntStringStringValue.getStringValue1());
final byte[] stringValue2 = BytesUtils.toBytes(tIntStringStringValue.getStringValue2());
// TODO increase by a more precise value
final int bufferSize = getBufferSize(stringValue1, stringValue2, 4 + 8);
final Buffer buffer = new AutomaticBuffer(bufferSize);
buffer.putSVInt(intValue);
buffer.putPrefixedBytes(stringValue1);
buffer.putPrefixedBytes(stringValue2);
return buffer.getBuffer();
}
use of com.navercorp.pinpoint.thrift.dto.TIntStringStringValue in project pinpoint by naver.
the class PluginTestAgent method verifySql.
private void verifySql(ExpectedSql expected, TAnnotation actual) {
int id = getTestTcpDataSender().getSqlId(expected.getQuery());
TIntStringStringValue value = actual.getValue().getIntStringStringValue();
if (value.getIntValue() != id) {
String actualQuery = getTestTcpDataSender().getSql(value.getIntValue());
throw new AssertionError("Expected sql [" + id + ": " + expected.getQuery() + "] but was [" + value.getIntValue() + ": " + actualQuery + "], expected: " + expected + ", was: " + actual);
}
if (!Objects.equal(value.getStringValue1(), expected.getOutput())) {
throw new AssertionError("Expected sql with output [" + expected.getOutput() + "] but was [" + value.getStringValue1() + "], expected: " + expected + ", was: " + actual);
}
if (!Objects.equal(value.getStringValue2(), expected.getBindValuesAsString())) {
throw new AssertionError("Expected sql with bindValues [" + expected.getBindValuesAsString() + "] but was [" + value.getStringValue2() + "], expected: " + expected + ", was: " + actual);
}
}
use of com.navercorp.pinpoint.thrift.dto.TIntStringStringValue 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);
}
Aggregations