use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class SpanUtils method getVarTransactionId.
public static byte[] getVarTransactionId(SpanBo span) {
Objects.requireNonNull(span, "span");
final TransactionId transactionId = span.getTransactionId();
String agentId = transactionId.getAgentId();
if (agentId == null) {
agentId = span.getAgentId();
}
final Buffer buffer = new AutomaticBuffer(32);
buffer.putPrefixedString(agentId);
buffer.putSVLong(transactionId.getAgentStartTime());
buffer.putVLong(transactionId.getTransactionSequence());
return buffer.getBuffer();
}
use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class HbaseHostApplicationMapDao method createKey.
private byte[] createKey(Application parentApplication, long time) {
Buffer buffer = new AutomaticBuffer();
buffer.putPadString(parentApplication.getName(), HbaseTableConstants.APPLICATION_NAME_MAX_LEN);
buffer.putShort(parentApplication.getServiceTypeCode());
buffer.putLong(time);
return buffer.getBuffer();
}
use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class AgentEventValueMapper method mapValue.
@Override
public byte[] mapValue(AgentEventBo value) {
final Buffer buffer = new AutomaticBuffer();
buffer.putInt(value.getVersion());
buffer.putPrefixedString(value.getAgentId());
buffer.putLong(value.getStartTimestamp());
buffer.putLong(value.getEventTimestamp());
buffer.putPrefixedBytes(value.getEventBody());
return buffer.getBuffer();
}
use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class AgentInfoMapper method createBuilderFromValue.
private AgentInfoBo.Builder createBuilderFromValue(byte[] serializedAgentInfo) {
final Buffer buffer = new FixedBuffer(serializedAgentInfo);
final AgentInfoBo.Builder builder = new AgentInfoBo.Builder();
builder.setHostName(buffer.readPrefixedString());
builder.setIp(buffer.readPrefixedString());
builder.setPorts(buffer.readPrefixedString());
builder.setApplicationName(buffer.readPrefixedString());
builder.setServiceTypeCode(buffer.readShort());
builder.setPid(buffer.readInt());
builder.setAgentVersion(buffer.readPrefixedString());
builder.setStartTime(buffer.readLong());
builder.setEndTimeStamp(buffer.readLong());
builder.setEndStatus(buffer.readInt());
// FIXME - 2015.09 v1.5.0 added vmVersion (check for compatibility)
if (buffer.hasRemaining()) {
builder.setVmVersion(buffer.readPrefixedString());
}
// FIXME - 2018.06 v1.8.0 added container (check for compatibility)
if (buffer.hasRemaining()) {
builder.isContainer(buffer.readBoolean());
}
// 2021.03.24 added agent name
if (buffer.hasRemaining()) {
builder.setAgentName(buffer.readPrefixedString());
}
return builder;
}
use of com.navercorp.pinpoint.common.buffer.Buffer in project pinpoint by naver.
the class HbaseHostApplicationMapDao method createRowKey0.
@VisibleForTesting
static byte[] createRowKey0(String parentApplicationName, short parentServiceType, long statisticsRowSlot, String parentAgentId) {
// even if a agentId be added for additional specifications, it may be safe to scan rows.
// But is it needed to add parentAgentServiceType?
final int SIZE = HbaseTableConstants.APPLICATION_NAME_MAX_LEN + 2 + 8;
final Buffer rowKeyBuffer = new AutomaticBuffer(SIZE);
rowKeyBuffer.putPadString(parentApplicationName, HbaseTableConstants.APPLICATION_NAME_MAX_LEN);
rowKeyBuffer.putShort(parentServiceType);
rowKeyBuffer.putLong(TimeUtils.reverseTimeMillis(statisticsRowSlot));
// rowKeyBuffer.putPadString(parentAgentId, HbaseTableConstants.AGENT_NAME_MAX_LEN);
return rowKeyBuffer.getBuffer();
}
Aggregations