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();
}
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();
}
Aggregations