use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class AnnotationTranscoder method decodeIntBooleanIntBooleanValue.
private Object decodeIntBooleanIntBooleanValue(byte[] data) {
final Buffer buffer = new FixedBuffer(data);
final int intValue1 = buffer.readVInt();
final boolean booleanValue1 = buffer.readBoolean();
final int intValue2 = buffer.readVInt();
final boolean booleanValue2 = buffer.readBoolean();
return new IntBooleanIntBooleanValue(intValue1, booleanValue1, intValue2, booleanValue2);
}
use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class AnnotationTranscoder method encodeLongIntIntByteByteStringValue.
private byte[] encodeLongIntIntByteByteStringValue(Object o) {
final LongIntIntByteByteStringValue value = (LongIntIntByteByteStringValue) o;
byte bitField = 0;
bitField = newBitField(value);
final byte[] stringValue = BytesUtils.toBytes(value.getStringValue());
// bitField + long + int + int + byte + byte + string
final int bufferSize = getBufferSize(stringValue, 1 + 8 + 4 + 4 + 1 + 1);
final Buffer buffer = new AutomaticBuffer(bufferSize);
buffer.putByte(bitField);
buffer.putVLong(value.getLongValue());
buffer.putVInt(value.getIntValue1());
if (isSetIntValue2(value)) {
buffer.putVInt(value.getIntValue2());
}
if (isSetByteValue1(value)) {
buffer.putByte(value.getByteValue1());
}
if (isSetByteValue2(value)) {
buffer.putByte(value.getByteValue2());
}
if (isSetStringValue(value)) {
buffer.putPrefixedBytes(stringValue);
}
return buffer.getBuffer();
}
use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class JvmInfoBo method writeValue.
public byte[] writeValue() {
final Buffer buffer = new AutomaticBuffer();
buffer.putByte(this.version);
int version = this.version & 0xFF;
switch(version) {
case 0:
buffer.putPrefixedString(this.jvmVersion);
buffer.putPrefixedString(this.gcTypeName);
break;
default:
break;
}
return buffer.getBuffer();
}
use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class ApplicationStatEncoder method encodeQualifier.
public ByteBuffer encodeQualifier(long timestampDelta) {
// Variable-length encoding of 5 minutes (300000 ms) takes up max 3 bytes
Buffer qualifierBuffer = new AutomaticBuffer(3);
qualifierBuffer.putVLong(timestampDelta);
return qualifierBuffer.wrapByteBuffer();
}
use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class ApplicationStatEncoder method encodeValue.
public ByteBuffer encodeValue(List<JoinStatBo> JoinStatBoList) {
Buffer valueBuffer = new AutomaticBuffer();
valueBuffer.putByte(this.codec.getVersion());
codec.encodeValues(valueBuffer, JoinStatBoList);
return valueBuffer.wrapByteBuffer();
}
Aggregations