Search in sources :

Example 6 with SqlMetaDataBo

use of com.navercorp.pinpoint.common.server.bo.SqlMetaDataBo in project pinpoint by naver.

the class SpanServiceImpl method collisionSqlIdCodeMessage.

private String collisionSqlIdCodeMessage(int sqlId, List<SqlMetaDataBo> sqlMetaDataList) {
    // TODO need a separate test case to test for hashCode collision (probability way too low for easy replication)
    StringBuilder sb = new StringBuilder(64);
    sb.append("Collision Sql sqlId:");
    sb.append(sqlId);
    sb.append('\n');
    for (int i = 0; i < sqlMetaDataList.size(); i++) {
        if (i != 0) {
            sb.append("or\n");
        }
        SqlMetaDataBo sqlMetaDataBo = sqlMetaDataList.get(i);
        sb.append(sqlMetaDataBo.getSql());
    }
    return sb.toString();
}
Also used : SqlMetaDataBo(com.navercorp.pinpoint.common.server.bo.SqlMetaDataBo)

Example 7 with SqlMetaDataBo

use of com.navercorp.pinpoint.common.server.bo.SqlMetaDataBo 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

SqlMetaDataBo (com.navercorp.pinpoint.common.server.bo.SqlMetaDataBo)7 ArrayList (java.util.ArrayList)3 AnnotationBo (com.navercorp.pinpoint.common.server.bo.AnnotationBo)2 IntStringStringValue (com.navercorp.pinpoint.common.util.IntStringStringValue)2 List (java.util.List)2 MetaDataRowKey (com.navercorp.pinpoint.common.server.bo.serializer.metadata.MetaDataRowKey)1 Header (com.navercorp.pinpoint.grpc.Header)1 TResult (com.navercorp.pinpoint.thrift.dto.TResult)1 Align (com.navercorp.pinpoint.web.calltree.span.Align)1 SpanAlign (com.navercorp.pinpoint.web.calltree.span.SpanAlign)1 Cell (org.apache.hadoop.hbase.Cell)1 Put (org.apache.hadoop.hbase.client.Put)1