Search in sources :

Example 66 with AutomaticBuffer

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

the class HbaseApplicationTraceIndexColumnTest method indexColumnName2.

@Test
public void indexColumnName2() {
    final int elapsed = 1234;
    final byte[] bytes = "thisisbytes".getBytes();
    final Buffer columnName = new AutomaticBuffer(16);
    columnName.putInt(elapsed);
    columnName.putPrefixedBytes(bytes);
}
Also used : Buffer(com.navercorp.pinpoint.common.buffer.Buffer) OffsetFixedBuffer(com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) Test(org.junit.Test)

Example 67 with AutomaticBuffer

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

the class HbaseApplicationTraceIndexColumnTest method indexedColumnName.

@Test
public void indexedColumnName() {
    final int elapsed = 1234;
    final String agentId = "agentId";
    final long agentStartTime = 1234567890L;
    final long transactionSequence = 1234567890L;
    // final Buffer buffer= new AutomaticBuffer(32);
    // buffer.putPrefixedString(agentId);
    // buffer.putSVar(transactionId.getAgentStartTime());
    // buffer.putVar(transactionId.getTransactionSequence());
    // return buffer.getBuffer();
    final Buffer originalBuffer = new AutomaticBuffer(16);
    originalBuffer.putVInt(elapsed);
    originalBuffer.putPrefixedString(agentId);
    originalBuffer.putSVLong(agentStartTime);
    originalBuffer.putVLong(transactionSequence);
    byte[] source = originalBuffer.getBuffer();
    final Buffer fetched = new OffsetFixedBuffer(source);
    Assert.assertEquals(elapsed, fetched.readVInt());
    Assert.assertEquals(agentId, fetched.readPrefixedString());
    Assert.assertEquals(agentStartTime, fetched.readSVLong());
    Assert.assertEquals(transactionSequence, fetched.readVLong());
}
Also used : Buffer(com.navercorp.pinpoint.common.buffer.Buffer) OffsetFixedBuffer(com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) AutomaticBuffer(com.navercorp.pinpoint.common.buffer.AutomaticBuffer) OffsetFixedBuffer(com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer) Test(org.junit.Test)

Example 68 with AutomaticBuffer

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

the class DefaultTransactionIdEncoder method newCache.

private byte[] newCache(String agentId) {
    final int agentIdSize = StringUtils.getLength(agentId);
    final Buffer buffer = new AutomaticBuffer(1 + 5 + agentIdSize);
    buffer.putByte(VERSION);
    buffer.putPrefixedString(agentId);
    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

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