Search in sources :

Example 21 with Buffer

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);
}
Also used : FixedBuffer(com.navercorp.pinpoint.common.buffer.FixedBuffer) Buffer(com.navercorp.pinpoint.common.buffer.Buffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) FixedBuffer(com.navercorp.pinpoint.common.buffer.FixedBuffer) IntBooleanIntBooleanValue(com.navercorp.pinpoint.common.util.IntBooleanIntBooleanValue)

Example 22 with Buffer

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();
}
Also used : FixedBuffer(com.navercorp.pinpoint.common.buffer.FixedBuffer) Buffer(com.navercorp.pinpoint.common.buffer.Buffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) LongIntIntByteByteStringValue(com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue)

Example 23 with Buffer

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();
}
Also used : FixedBuffer(com.navercorp.pinpoint.common.buffer.FixedBuffer) Buffer(com.navercorp.pinpoint.common.buffer.Buffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer)

Example 24 with Buffer

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();
}
Also used : Buffer(com.navercorp.pinpoint.common.buffer.Buffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) ByteBuffer(java.nio.ByteBuffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer)

Example 25 with Buffer

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();
}
Also used : Buffer(com.navercorp.pinpoint.common.buffer.Buffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) ByteBuffer(java.nio.ByteBuffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer)

Aggregations

Buffer (com.navercorp.pinpoint.common.buffer.Buffer)107 AutomaticBuffer (com.navercorp.pinpoint.common.buffer.AutomaticBuffer)76 FixedBuffer (com.navercorp.pinpoint.common.buffer.FixedBuffer)57 ByteBuffer (java.nio.ByteBuffer)27 Test (org.junit.Test)24 OffsetFixedBuffer (com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer)15 ApplicationStatDecodingContext (com.navercorp.pinpoint.common.server.bo.serializer.stat.ApplicationStatDecodingContext)11 JoinStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo)11 AgentStatDataPointCodec (com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDataPointCodec)10 Date (java.util.Date)10 SpanEventBo (com.navercorp.pinpoint.common.server.bo.SpanEventBo)9 Cell (org.apache.hadoop.hbase.Cell)9 SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)8 ArrayList (java.util.ArrayList)6 AnnotationBo (com.navercorp.pinpoint.common.server.bo.AnnotationBo)5 TransactionId (com.navercorp.pinpoint.common.profiler.util.TransactionId)4 IntStringStringValue (com.navercorp.pinpoint.common.util.IntStringStringValue)4 TransactionId (com.navercorp.pinpoint.common.util.TransactionId)4 Put (org.apache.hadoop.hbase.client.Put)4 SpanChunkBo (com.navercorp.pinpoint.common.server.bo.SpanChunkBo)3