Example #1
0
 @Override
 public List<SpanBo> selectSpan(TransactionId transactionId) {
   if (transactionId == null) {
     throw new NullPointerException("transactionId must not be null");
   }
   byte[] transactionIdRowKey = rowKeyDecoder.encodeRowKey(transactionId);
   return template2.get(
       HBaseTables.TRACES, transactionIdRowKey, HBaseTables.TRACES_CF_SPAN, spanMapper);
 }
Example #2
0
 @Override
 public List<SpanBo> selectSpans(TransactionId transactionId) {
   if (transactionId == null) {
     throw new NullPointerException("transactionId must not be null");
   }
   byte[] transactionIdRowKey = rowKeyDecoder.encodeRowKey(transactionId);
   Get get = new Get(transactionIdRowKey);
   get.addFamily(HBaseTables.TRACES_CF_SPAN);
   get.addFamily(HBaseTables.TRACES_CF_TERMINALSPAN);
   return template2.get(HBaseTables.TRACES, get, spanMapper);
 }
  @Override
  public List<SqlMetaDataBo> getSqlMetaData(String agentId, long time, int hashCode) {
    if (agentId == null) {
      throw new NullPointerException("agentId must not be null");
    }

    SqlMetaDataBo sqlMetaData = new SqlMetaDataBo(agentId, time, hashCode);
    byte[] sqlId = getDistributedKey(sqlMetaData.toRowKey());

    Get get = new Get(sqlId);
    get.addFamily(HBaseTables.SQL_METADATA_CF_SQL);

    return hbaseOperations2.get(HBaseTables.SQL_METADATA, get, sqlMetaDataMapper);
  }
Example #4
0
  private List<List<SpanBo>> getSpans0(
      List<TransactionId> transactionIdList, List<byte[]> hBaseFamiliyList) {
    if (transactionIdList == null || transactionIdList.isEmpty()) {
      return Collections.emptyList();
    }

    if (hBaseFamiliyList == null) {
      throw new NullPointerException("hBaseFamiliyList may not be null.");
    }

    final List<Get> getList = new ArrayList<>(transactionIdList.size());
    for (TransactionId transactionId : transactionIdList) {
      byte[] transactionIdRowKey = rowKeyDecoder.encodeRowKey(transactionId);
      final Get get = new Get(transactionIdRowKey);
      for (byte[] hbaseFamily : hBaseFamiliyList) {
        get.addFamily(hbaseFamily);
      }
      getList.add(get);
    }
    return template2.get(HBaseTables.TRACES, getList, spanMapper);
  }