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