Search in sources :

Example 6 with MetaDataRowKey

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;
}
Also used : MetaDataRowKey(com.navercorp.pinpoint.common.server.bo.serializer.metadata.MetaDataRowKey) SqlMetaDataBo(com.navercorp.pinpoint.common.server.bo.SqlMetaDataBo) ArrayList(java.util.ArrayList) Cell(org.apache.hadoop.hbase.Cell)

Aggregations

MetaDataRowKey (com.navercorp.pinpoint.common.server.bo.serializer.metadata.MetaDataRowKey)6 DefaultMetaDataRowKey (com.navercorp.pinpoint.common.server.bo.serializer.metadata.DefaultMetaDataRowKey)3 ArrayList (java.util.ArrayList)3 Cell (org.apache.hadoop.hbase.Cell)3 TableName (org.apache.hadoop.hbase.TableName)3 Get (org.apache.hadoop.hbase.client.Get)3 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)1 FixedBuffer (com.navercorp.pinpoint.common.buffer.FixedBuffer)1 ApiMetaDataBo (com.navercorp.pinpoint.common.server.bo.ApiMetaDataBo)1 MethodTypeEnum (com.navercorp.pinpoint.common.server.bo.MethodTypeEnum)1 SqlMetaDataBo (com.navercorp.pinpoint.common.server.bo.SqlMetaDataBo)1 StringMetaDataBo (com.navercorp.pinpoint.common.server.bo.StringMetaDataBo)1 Cacheable (org.springframework.cache.annotation.Cacheable)1