Search in sources :

Example 1 with TraceIndexScatterMapper3

use of com.navercorp.pinpoint.web.mapper.TraceIndexScatterMapper3 in project pinpoint by naver.

the class HbaseApplicationTraceIndexDao method scanTraceScatterData.

@Override
public ScatterData scanTraceScatterData(String applicationName, Range range, int xGroupUnit, int yGroupUnit, int limit, boolean scanBackward) {
    if (applicationName == null) {
        throw new NullPointerException("applicationName must not be null");
    }
    if (range == null) {
        throw new NullPointerException("range must not be null");
    }
    if (limit < 0) {
        throw new IllegalArgumentException("negative limit:" + limit);
    }
    logger.debug("scanTraceScatterDataMadeOfDotGroup");
    Scan scan = createScan(applicationName, range, scanBackward);
    TraceIndexScatterMapper3 mapper = new TraceIndexScatterMapper3(range.getFrom(), range.getTo(), xGroupUnit, yGroupUnit);
    List<ScatterData> dotGroupList = hbaseOperations2.findParallel(HBaseTables.APPLICATION_TRACE_INDEX, scan, traceIdRowKeyDistributor, limit, mapper, APPLICATION_TRACE_INDEX_NUM_PARTITIONS);
    if (CollectionUtils.isEmpty(dotGroupList)) {
        return new ScatterData(range.getFrom(), range.getTo(), xGroupUnit, yGroupUnit);
    } else {
        ScatterData firstScatterData = dotGroupList.get(0);
        for (int i = 1; i < dotGroupList.size(); i++) {
            firstScatterData.merge(dotGroupList.get(i));
        }
        return firstScatterData;
    }
}
Also used : TraceIndexScatterMapper3(com.navercorp.pinpoint.web.mapper.TraceIndexScatterMapper3) Scan(org.apache.hadoop.hbase.client.Scan) ScatterData(com.navercorp.pinpoint.web.scatter.ScatterData)

Aggregations

TraceIndexScatterMapper3 (com.navercorp.pinpoint.web.mapper.TraceIndexScatterMapper3)1 ScatterData (com.navercorp.pinpoint.web.scatter.ScatterData)1 Scan (org.apache.hadoop.hbase.client.Scan)1