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);
}
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);
}
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);
}
}
}
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);
}
}
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);
}
}
}
Aggregations