Search in sources :

Example 46 with AutomaticBuffer

use of com.navercorp.pinpoint.common.buffer.AutomaticBuffer 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 47 with AutomaticBuffer

use of com.navercorp.pinpoint.common.buffer.AutomaticBuffer in project pinpoint by naver.

the class TransactionIdUtilsTest method writeTransactionId_for_compatibility.

private static ByteBuffer writeTransactionId_for_compatibility(String agentId, long agentStartTime, long transactionSequence) {
    final Buffer buffer = new AutomaticBuffer(1 + 5 + 24 + 10 + 10);
    buffer.putByte(TransactionIdUtils.VERSION);
    buffer.putPrefixedString(agentId);
    buffer.putVLong(agentStartTime);
    buffer.putVLong(transactionSequence);
    return buffer.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 48 with AutomaticBuffer

use of com.navercorp.pinpoint.common.buffer.AutomaticBuffer in project pinpoint by naver.

the class AgentStatEncoder method encodeValue.

public ByteBuffer encodeValue(List<T> agentStatDataPoints) {
    Buffer valueBuffer = new AutomaticBuffer();
    valueBuffer.putByte(this.codec.getVersion());
    codec.encodeValues(valueBuffer, agentStatDataPoints);
    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)

Example 49 with AutomaticBuffer

use of com.navercorp.pinpoint.common.buffer.AutomaticBuffer in project pinpoint by naver.

the class ServerMetaDataBo method writeValue.

public byte[] writeValue() {
    final Buffer buffer = new AutomaticBuffer();
    buffer.put2PrefixedString(this.serverInfo);
    final int numVmArgs = this.vmArgs == null ? 0 : this.vmArgs.size();
    buffer.putVInt(numVmArgs);
    if (this.vmArgs != null) {
        for (String vmArg : this.vmArgs) {
            buffer.put2PrefixedString(vmArg);
        }
    }
    final int numServiceInfos = this.serviceInfos == null ? 0 : this.serviceInfos.size();
    buffer.putVInt(numServiceInfos);
    if (this.serviceInfos != null) {
        for (ServiceInfoBo serviceInfo : this.serviceInfos) {
            buffer.putPrefixedBytes(serviceInfo.writeValue());
        }
    }
    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 50 with AutomaticBuffer

use of com.navercorp.pinpoint.common.buffer.AutomaticBuffer in project pinpoint by naver.

the class AgentInfoBo method writeValue.

public byte[] writeValue() {
    final Buffer buffer = new AutomaticBuffer();
    buffer.putPrefixedString(this.getHostName());
    buffer.putPrefixedString(this.getIp());
    buffer.putPrefixedString(this.getPorts());
    buffer.putPrefixedString(this.getApplicationName());
    buffer.putShort(this.getServiceTypeCode());
    buffer.putInt(this.getPid());
    buffer.putPrefixedString(this.getAgentVersion());
    buffer.putLong(this.getStartTime());
    buffer.putLong(this.getEndTimeStamp());
    buffer.putInt(this.getEndStatus());
    buffer.putPrefixedString(this.getVmVersion());
    buffer.putBoolean(this.isContainer());
    buffer.putPrefixedString(this.getAgentName());
    return buffer.getBuffer();
}
Also used : Buffer(com.navercorp.pinpoint.common.buffer.Buffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer)

Aggregations

AutomaticBuffer (com.navercorp.pinpoint.common.buffer.AutomaticBuffer)68 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)68 FixedBuffer (com.navercorp.pinpoint.common.buffer.FixedBuffer)30 Test (org.junit.Test)16 ByteBuffer (java.nio.ByteBuffer)15 AgentStatDataPointCodec (com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDataPointCodec)10 ApplicationStatDecodingContext (com.navercorp.pinpoint.common.server.bo.serializer.stat.ApplicationStatDecodingContext)10 JoinStatBo (com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo)10 Date (java.util.Date)10 SpanEventBo (com.navercorp.pinpoint.common.server.bo.SpanEventBo)4 Put (org.apache.hadoop.hbase.client.Put)4 AnnotationBo (com.navercorp.pinpoint.common.server.bo.AnnotationBo)3 IntStringStringValue (com.navercorp.pinpoint.common.util.IntStringStringValue)3 OffsetFixedBuffer (com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer)2 BasicSpan (com.navercorp.pinpoint.common.server.bo.BasicSpan)2 StringStringValue (com.navercorp.pinpoint.common.util.StringStringValue)2 TableName (org.apache.hadoop.hbase.TableName)2 VisibleForTesting (com.navercorp.pinpoint.common.annotations.VisibleForTesting)1 TransactionId (com.navercorp.pinpoint.common.profiler.util.TransactionId)1 ApiMetaDataBo (com.navercorp.pinpoint.common.server.bo.ApiMetaDataBo)1