Search in sources :

Example 41 with Buffer

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

the class HbaseHostApplicationMapDao method createColumnName.

private byte[] createColumnName(String host, String bindApplicationName, short bindServiceType) {
    Buffer buffer = new AutomaticBuffer();
    buffer.putPrefixedString(host);
    buffer.putPrefixedString(bindApplicationName);
    buffer.putShort(bindServiceType);
    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)

Example 42 with Buffer

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

the class HbaseApiMetaDataDao method insert.

@Override
public void insert(ApiMetaDataBo apiMetaData) {
    Objects.requireNonNull(apiMetaData, "apiMetaData");
    if (logger.isDebugEnabled()) {
        logger.debug("insert:{}", apiMetaData);
    }
    // Assert agentId
    CollectorUtils.checkAgentId(apiMetaData.getAgentId());
    final byte[] rowKey = getDistributedKey(rowKeyEncoder.encodeRowKey(apiMetaData));
    final Put put = new Put(rowKey);
    final Buffer buffer = new AutomaticBuffer(64);
    final String api = apiMetaData.getApiInfo();
    buffer.putPrefixedString(api);
    buffer.putInt(apiMetaData.getLineNumber());
    buffer.putInt(apiMetaData.getMethodTypeEnum().getCode());
    final byte[] apiMetaDataBytes = buffer.getBuffer();
    put.addColumn(description.getName(), description.QUALIFIER_SIGNATURE, apiMetaDataBytes);
    final TableName apiMetaDataTableName = tableNameProvider.getTableName(description.getTable());
    hbaseTemplate.put(apiMetaDataTableName, put);
}
Also used : Buffer(com.navercorp.pinpoint.common.buffer.Buffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) TableName(org.apache.hadoop.hbase.TableName) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) Put(org.apache.hadoop.hbase.client.Put)

Example 43 with Buffer

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

the class CalleeColumnName method getColumnName.

public byte[] getColumnName() {
    final Buffer buffer = new AutomaticBuffer(64);
    buffer.putShort(calleeServiceType);
    buffer.putPrefixedString(calleeApplicationName);
    buffer.putPrefixedString(callHost);
    buffer.putShort(columnSlotNumber);
    buffer.putPrefixedString(callerAgentId);
    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)

Example 44 with Buffer

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

the class TransactionIdUtils method parseTransactionId.

public static TransactionId parseTransactionId(final byte[] transactionId, String defaultAgentId) {
    Objects.requireNonNull(transactionId, "transactionId");
    final Buffer buffer = new FixedBuffer(transactionId);
    final byte version = buffer.readByte();
    if (version != VERSION) {
        throw new IllegalArgumentException("invalid Version");
    }
    String agentId = buffer.readPrefixedString();
    agentId = StringUtils.defaultString(agentId, defaultAgentId);
    if (!IdValidateUtils.validateId(agentId)) {
        throw new IllegalArgumentException("invalid transactionId:" + transactionId);
    }
    final long agentStartTime = buffer.readVLong();
    final long transactionSequence = buffer.readVLong();
    return new TransactionId(agentId, agentStartTime, transactionSequence);
}
Also used : FixedBuffer(com.navercorp.pinpoint.common.buffer.FixedBuffer) Buffer(com.navercorp.pinpoint.common.buffer.Buffer) ByteBuffer(java.nio.ByteBuffer) FixedBuffer(com.navercorp.pinpoint.common.buffer.FixedBuffer)

Example 45 with Buffer

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

the class DefaultTransactionIdEncoder method newCache.

private byte[] newCache(String agentId, long agentStartTime) {
    final int agentStartTimeSize = BytesUtils.computeVar64Size(agentStartTime);
    final int agentIdSize = StringUtils.getLength(agentId);
    final Buffer buffer = new AutomaticBuffer(1 + 5 + agentIdSize + agentStartTimeSize);
    buffer.putByte(VERSION);
    buffer.putPrefixedString(agentId);
    buffer.putVLong(agentStartTime);
    return buffer.copyBuffer();
}
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