use of com.navercorp.pinpoint.common.server.bo.serializer.metadata.MetaDataRowKey in project pinpoint by naver.
the class HbaseSqlMetaDataDao method getSqlMetaData.
@Override
public List<SqlMetaDataBo> getSqlMetaData(String agentId, long time, int sqlId) {
Objects.requireNonNull(agentId, "agentId");
MetaDataRowKey metaDataRowKey = new DefaultMetaDataRowKey(agentId, time, sqlId);
byte[] rowKey = getDistributedKey(rowKeyEncoder.encodeRowKey(metaDataRowKey));
Get get = new Get(rowKey);
get.addFamily(DESCRIPTOR.getName());
TableName sqlMetaDataTableName = tableNameProvider.getTableName(DESCRIPTOR.getTable());
return hbaseOperations2.get(sqlMetaDataTableName, get, sqlMetaDataMapper);
}
use of com.navercorp.pinpoint.common.server.bo.serializer.metadata.MetaDataRowKey in project pinpoint by naver.
the class StringMetaDataMapper method mapRow.
@Override
public List<StringMetaDataBo> mapRow(Result result, int rowNum) throws Exception {
if (result.isEmpty()) {
return Collections.emptyList();
}
final byte[] rowKey = getOriginalKey(result.getRow());
final MetaDataRowKey key = decoder.decodeRowKey(rowKey);
List<StringMetaDataBo> stringMetaDataList = new ArrayList<>();
for (Cell cell : result.rawCells()) {
String stringValue = Bytes.toString(cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength());
if (STRING_METADATA_CF_STR_QUALI_STRING.equals(stringValue)) {
stringValue = Bytes.toString(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());
}
StringMetaDataBo stringMetaDataBo = new StringMetaDataBo(key.getAgentId(), key.getAgentStartTime(), key.getId(), stringValue);
stringMetaDataList.add(stringMetaDataBo);
}
return stringMetaDataList;
}
use of com.navercorp.pinpoint.common.server.bo.serializer.metadata.MetaDataRowKey in project pinpoint by naver.
the class ApiMetaDataMapper method mapRow.
@Override
public List<ApiMetaDataBo> mapRow(Result result, int rowNum) throws Exception {
if (result.isEmpty()) {
return Collections.emptyList();
}
final byte[] rowKey = getOriginalKey(result.getRow());
final MetaDataRowKey key = decoder.decodeRowKey(rowKey);
List<ApiMetaDataBo> apiMetaDataList = new ArrayList<>();
for (Cell cell : result.rawCells()) {
final byte[] value = getValue(cell);
Buffer buffer = new FixedBuffer(value);
final String apiInfo = buffer.readPrefixedString();
final int lineNumber = buffer.readInt();
MethodTypeEnum methodTypeEnum = MethodTypeEnum.DEFAULT;
if (buffer.hasRemaining()) {
methodTypeEnum = MethodTypeEnum.valueOf(buffer.readInt());
}
ApiMetaDataBo apiMetaDataBo = new ApiMetaDataBo(key.getAgentId(), key.getAgentStartTime(), key.getId(), lineNumber, methodTypeEnum, apiInfo);
apiMetaDataList.add(apiMetaDataBo);
if (logger.isDebugEnabled()) {
logger.debug("read apiAnnotation:{}", apiMetaDataBo);
}
}
return apiMetaDataList;
}
use of com.navercorp.pinpoint.common.server.bo.serializer.metadata.MetaDataRowKey in project pinpoint by naver.
the class HbaseStringMetaDataDao method getStringMetaData.
@Override
public List<StringMetaDataBo> getStringMetaData(String agentId, long time, int stringId) {
Objects.requireNonNull(agentId, "agentId");
MetaDataRowKey metaDataRowKey = new DefaultMetaDataRowKey(agentId, time, stringId);
byte[] rowKey = getDistributedKey(rowKeyEncoder.encodeRowKey(metaDataRowKey));
Get get = new Get(rowKey);
get.addFamily(DESCRIPTOR.getName());
TableName stringMetaDataTableName = tableNameProvider.getTableName(DESCRIPTOR.getTable());
return hbaseOperations2.get(stringMetaDataTableName, get, stringMetaDataMapper);
}
use of com.navercorp.pinpoint.common.server.bo.serializer.metadata.MetaDataRowKey in project pinpoint by naver.
the class HbaseApiMetaDataDao method getApiMetaData.
@Override
@Cacheable(cacheNames = "apiMetaData", key = SPEL_KEY, cacheManager = CacheConfiguration.API_METADATA_CACHE_NAME)
public List<ApiMetaDataBo> getApiMetaData(String agentId, long time, int apiId) {
Objects.requireNonNull(agentId, "agentId");
MetaDataRowKey metaDataRowKey = new DefaultMetaDataRowKey(agentId, time, apiId);
byte[] sqlId = getDistributedKey(rowKeyEncoder.encodeRowKey(metaDataRowKey));
Get get = new Get(sqlId);
get.addFamily(DESCRIPTOR.getName());
TableName apiMetaDataTableName = tableNameProvider.getTableName(DESCRIPTOR.getTable());
return hbaseOperations2.get(apiMetaDataTableName, get, apiMetaDataMapper);
}
Aggregations