use of com.navercorp.pinpoint.common.server.bo.serializer.metadata.MetaDataRowKey in project pinpoint by naver.
the class SqlMetaDataMapper method mapRow.
@Override
public List<SqlMetaDataBo> 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<SqlMetaDataBo> sqlMetaDataList = new ArrayList<>();
for (Cell cell : result.rawCells()) {
String sql = Bytes.toString(cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength());
if (SQL_METADATA_CF_SQL_QUALI_SQLSTATEMENT.equals(sql)) {
sql = Bytes.toString(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());
}
SqlMetaDataBo sqlMetaDataBo = new SqlMetaDataBo(key.getAgentId(), key.getAgentStartTime(), key.getId(), sql);
sqlMetaDataList.add(sqlMetaDataBo);
}
return sqlMetaDataList;
}
Aggregations