use of com.navercorp.pinpoint.web.vo.LimitedScanResult in project pinpoint by naver.
the class HbaseApplicationTraceIndexDao method scanTraceIndex.
@Override
public LimitedScanResult<List<TransactionId>> scanTraceIndex(final String applicationName, SelectedScatterArea area, int limit) {
if (applicationName == null) {
throw new NullPointerException("applicationName must not be null");
}
if (area == null) {
throw new NullPointerException("area must not be null");
}
if (limit < 0) {
throw new IllegalArgumentException("negative limit:" + limit);
}
logger.debug("scanTraceIndex");
Scan scan = createScan(applicationName, area.getTimeRange());
final LimitedScanResult<List<TransactionId>> limitedScanResult = new LimitedScanResult<>();
LastRowAccessor lastRowAccessor = new LastRowAccessor();
List<List<TransactionId>> traceIndexList = hbaseOperations2.findParallel(HBaseTables.APPLICATION_TRACE_INDEX, scan, traceIdRowKeyDistributor, limit, traceIndexMapper, lastRowAccessor, APPLICATION_TRACE_INDEX_NUM_PARTITIONS);
List<TransactionId> transactionIdSum = new ArrayList<>(128);
for (List<TransactionId> transactionId : traceIndexList) {
transactionIdSum.addAll(transactionId);
}
limitedScanResult.setScanData(transactionIdSum);
if (transactionIdSum.size() >= limit) {
Long lastRowTimestamp = lastRowAccessor.getLastRowTimestamp();
limitedScanResult.setLimitedTime(lastRowTimestamp);
if (logger.isDebugEnabled()) {
logger.debug("lastRowTimestamp lastTime:{}", DateUtils.longToDateStr(lastRowTimestamp));
}
} else {
if (logger.isDebugEnabled()) {
logger.debug("scanner start lastTime:{}", DateUtils.longToDateStr(area.getTimeRange().getFrom()));
}
limitedScanResult.setLimitedTime(area.getTimeRange().getFrom());
}
return limitedScanResult;
}
use of com.navercorp.pinpoint.web.vo.LimitedScanResult in project pinpoint by naver.
the class HbaseApplicationTraceIndexDao method scanTraceIndex.
@Override
public LimitedScanResult<List<TransactionId>> scanTraceIndex(final String applicationName, Range range, 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("scanTraceIndex");
Scan scan = createScan(applicationName, range, scanBackward);
final LimitedScanResult<List<TransactionId>> limitedScanResult = new LimitedScanResult<>();
LastRowAccessor lastRowAccessor = new LastRowAccessor();
List<List<TransactionId>> traceIndexList = hbaseOperations2.findParallel(HBaseTables.APPLICATION_TRACE_INDEX, scan, traceIdRowKeyDistributor, limit, traceIndexMapper, lastRowAccessor, APPLICATION_TRACE_INDEX_NUM_PARTITIONS);
List<TransactionId> transactionIdSum = new ArrayList<>(128);
for (List<TransactionId> transactionId : traceIndexList) {
transactionIdSum.addAll(transactionId);
}
limitedScanResult.setScanData(transactionIdSum);
if (transactionIdSum.size() >= limit) {
Long lastRowTimestamp = lastRowAccessor.getLastRowTimestamp();
limitedScanResult.setLimitedTime(lastRowTimestamp);
if (logger.isDebugEnabled()) {
logger.debug("lastRowTimestamp lastTime:{}", DateUtils.longToDateStr(lastRowTimestamp));
}
} else {
if (logger.isDebugEnabled()) {
logger.debug("scanner start lastTime:{}", DateUtils.longToDateStr(range.getFrom()));
}
limitedScanResult.setLimitedTime(range.getFrom());
}
return limitedScanResult;
}
Aggregations