Search in sources :

Example 1 with RowMapReduceResultExtractor

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

the class HbaseMapStatisticsCalleeDao method selectCallee.

@Override
public LinkDataMap selectCallee(Application calleeApplication, Range range) {
    Objects.requireNonNull(calleeApplication, "calleeApplication");
    Objects.requireNonNull(range, "range");
    final TimeWindow timeWindow = new TimeWindow(range, TimeWindowDownSampler.SAMPLER);
    // find distributed key - ver2.
    final Scan scan = createScan(calleeApplication, range, DESCRIPTOR.getName());
    ResultsExtractor<LinkDataMap> resultExtractor = new RowMapReduceResultExtractor<>(mapStatisticsCalleeMapper, new MapStatisticsTimeWindowReducer(timeWindow));
    TableName mapStatisticsCallerTableName = tableNameProvider.getTableName(DESCRIPTOR.getTable());
    LinkDataMap linkDataMap = hbaseTemplate.findParallel(mapStatisticsCallerTableName, scan, rowKeyDistributorByHashPrefix, resultExtractor, MAP_STATISTICS_CALLER_VER2_NUM_PARTITIONS);
    logger.debug("Callee data. {}, {}", linkDataMap, range);
    if (linkDataMap != null && linkDataMap.size() > 0) {
        return linkDataMap;
    }
    return new LinkDataMap();
}
Also used : TableName(org.apache.hadoop.hbase.TableName) MapStatisticsTimeWindowReducer(com.navercorp.pinpoint.web.mapper.MapStatisticsTimeWindowReducer) Scan(org.apache.hadoop.hbase.client.Scan) TimeWindow(com.navercorp.pinpoint.web.util.TimeWindow) RowMapReduceResultExtractor(com.navercorp.pinpoint.web.mapper.RowMapReduceResultExtractor) LinkDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)

Example 2 with RowMapReduceResultExtractor

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

the class HbaseMapStatisticsCallerDao method selectCaller.

@Override
public LinkDataMap selectCaller(Application callerApplication, Range range) {
    Objects.requireNonNull(callerApplication, "callerApplication");
    Objects.requireNonNull(range, "range");
    final TimeWindow timeWindow = new TimeWindow(range, TimeWindowDownSampler.SAMPLER);
    // find distributed key.
    final Scan scan = createScan(callerApplication, range, DESCRIPTOR.getName());
    ResultsExtractor<LinkDataMap> resultExtractor = new RowMapReduceResultExtractor<>(mapStatisticsCallerMapper, new MapStatisticsTimeWindowReducer(timeWindow));
    TableName mapStatisticsCalleeTableName = tableNameProvider.getTableName(DESCRIPTOR.getTable());
    LinkDataMap linkDataMap = this.hbaseTemplate.findParallel(mapStatisticsCalleeTableName, scan, rowKeyDistributorByHashPrefix, resultExtractor, MAP_STATISTICS_CALLEE_VER2_NUM_PARTITIONS);
    logger.debug("tableInfo({}). Caller data. {}, {} : ", mapStatisticsCalleeTableName.getNameAsString(), linkDataMap, range);
    if (linkDataMap != null && linkDataMap.size() > 0) {
        return linkDataMap;
    }
    return new LinkDataMap();
}
Also used : TableName(org.apache.hadoop.hbase.TableName) MapStatisticsTimeWindowReducer(com.navercorp.pinpoint.web.mapper.MapStatisticsTimeWindowReducer) Scan(org.apache.hadoop.hbase.client.Scan) TimeWindow(com.navercorp.pinpoint.web.util.TimeWindow) RowMapReduceResultExtractor(com.navercorp.pinpoint.web.mapper.RowMapReduceResultExtractor) LinkDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)

Aggregations

LinkDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)2 MapStatisticsTimeWindowReducer (com.navercorp.pinpoint.web.mapper.MapStatisticsTimeWindowReducer)2 RowMapReduceResultExtractor (com.navercorp.pinpoint.web.mapper.RowMapReduceResultExtractor)2 TimeWindow (com.navercorp.pinpoint.web.util.TimeWindow)2 TableName (org.apache.hadoop.hbase.TableName)2 Scan (org.apache.hadoop.hbase.client.Scan)2