Search in sources :

Example 21 with TransactionId

use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.

the class HbaseTraceDao method select0.

private List<List<SpanBo>> select0(List<TransactionId> transactionIdList, List<byte[]> hBaseFamilyList) {
    if (CollectionUtils.isEmpty(transactionIdList)) {
        return Collections.emptyList();
    }
    final List<Get> multiGet = new ArrayList<>(transactionIdList.size());
    for (TransactionId transactionId : transactionIdList) {
        final Get get = createGet(transactionId, hBaseFamilyList);
        multiGet.add(get);
    }
    return template2.get(HBaseTables.TRACES, multiGet, spanMapper);
}
Also used : Get(org.apache.hadoop.hbase.client.Get) ArrayList(java.util.ArrayList) TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Example 22 with TransactionId

use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.

the class DotSerializerTest method testSerialize.

@Test
public void testSerialize() throws Exception {
    TransactionId transactionId = TransactionIdUtils.parseTransactionId("aigw.dev.1^1395798795017^1527177");
    Dot dot = new Dot(transactionId, 100, 99, 1, "agent");
    String jsonValue = mapper.writeValueAsString(dot);
    Assert.assertEquals("[100,99,\"aigw.dev.1^1395798795017^1527177\",0]", jsonValue);
}
Also used : Dot(com.navercorp.pinpoint.web.vo.scatter.Dot) TransactionId(com.navercorp.pinpoint.common.util.TransactionId) Test(org.junit.Test)

Example 23 with TransactionId

use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.

the class HbaseTraceDao method insertSpanChunk.

@Override
public void insertSpanChunk(SpanChunkBo spanChunkBo) {
    TransactionId transactionId = spanChunkBo.getTransactionId();
    final byte[] rowKey = rowKeyEncoder.encodeRowKey(transactionId);
    final long acceptedTime = acceptedTimeService.getAcceptedTime();
    final Put put = new Put(rowKey, acceptedTime);
    final List<SpanEventBo> spanEventBoList = spanChunkBo.getSpanEventBoList();
    if (CollectionUtils.isEmpty(spanEventBoList)) {
        return;
    }
    for (SpanEventBo spanEventBo : spanEventBoList) {
        addColumn(put, spanChunkBo, spanEventBo);
    }
    if (!put.isEmpty()) {
        boolean success = hbaseTemplate.asyncPut(TRACES, put);
        if (!success) {
            hbaseTemplate.put(TRACES, put);
        }
    }
}
Also used : Put(org.apache.hadoop.hbase.client.Put) SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo) TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Example 24 with TransactionId

use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.

the class HbaseTraceDaoV2 method insert.

@Override
public void insert(final SpanBo spanBo) {
    if (spanBo == null) {
        throw new NullPointerException("spanBo must not be null");
    }
    long acceptedTime = spanBo.getCollectorAcceptTime();
    TransactionId transactionId = spanBo.getTransactionId();
    final byte[] rowKey = this.rowKeyEncoder.encodeRowKey(transactionId);
    final Put put = new Put(rowKey, acceptedTime);
    this.spanSerializer.serialize(spanBo, put, null);
    boolean success = hbaseTemplate.asyncPut(TRACE_V2, put);
    if (!success) {
        hbaseTemplate.put(TRACE_V2, put);
    }
}
Also used : Put(org.apache.hadoop.hbase.client.Put) TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Example 25 with TransactionId

use of com.navercorp.pinpoint.common.util.TransactionId in project pinpoint by naver.

the class HbaseTraceDaoV2 method insertSpanChunk.

@Override
public void insertSpanChunk(SpanChunkBo spanChunkBo) {
    TransactionId transactionId = spanChunkBo.getTransactionId();
    final byte[] rowKey = this.rowKeyEncoder.encodeRowKey(transactionId);
    final long acceptedTime = spanChunkBo.getCollectorAcceptTime();
    final Put put = new Put(rowKey, acceptedTime);
    final List<SpanEventBo> spanEventBoList = spanChunkBo.getSpanEventBoList();
    if (CollectionUtils.isEmpty(spanEventBoList)) {
        return;
    }
    this.spanChunkSerializer.serialize(spanChunkBo, put, null);
    if (!put.isEmpty()) {
        boolean success = hbaseTemplate.asyncPut(TRACE_V2, put);
        if (!success) {
            hbaseTemplate.put(TRACE_V2, put);
        }
    }
}
Also used : Put(org.apache.hadoop.hbase.client.Put) SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo) TransactionId(com.navercorp.pinpoint.common.util.TransactionId)

Aggregations

TransactionId (com.navercorp.pinpoint.common.util.TransactionId)44 ArrayList (java.util.ArrayList)11 Dot (com.navercorp.pinpoint.web.vo.scatter.Dot)9 Test (org.junit.Test)9 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)8 SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)8 OffsetFixedBuffer (com.navercorp.pinpoint.common.buffer.OffsetFixedBuffer)7 SpanEventBo (com.navercorp.pinpoint.common.server.bo.SpanEventBo)5 List (java.util.List)5 Put (org.apache.hadoop.hbase.client.Put)4 ByteBuffer (java.nio.ByteBuffer)3 Cell (org.apache.hadoop.hbase.Cell)3 SpanChunkBo (com.navercorp.pinpoint.common.server.bo.SpanChunkBo)2 TSpan (com.navercorp.pinpoint.thrift.dto.TSpan)2 TSpanEvent (com.navercorp.pinpoint.thrift.dto.TSpanEvent)2 ScatterData (com.navercorp.pinpoint.web.scatter.ScatterData)2 LimitedScanResult (com.navercorp.pinpoint.web.vo.LimitedScanResult)2 Get (org.apache.hadoop.hbase.client.Get)2 Scan (org.apache.hadoop.hbase.client.Scan)2 FilterList (org.apache.hadoop.hbase.filter.FilterList)2