HBASE-18814 Make ScanMetrics enabled and add counter <HBase Counters, ROWS_SCANNED> into the MapReduce Job over snapshot

Signed-off-by: Ashu Pachauri <ashu@apache.org>
This commit is contained in:
libisthanks 2017-09-14 09:58:34 +08:00 committed by Ashu Pachauri
parent 61173522db
commit 1c7321f9d5
2 changed files with 2 additions and 0 deletions

View File

@ -86,6 +86,7 @@ public class ClientSideRegionScanner extends AbstractClientScanner {
resultSize += CellUtil.estimatedSerializedSizeOf(cell);
}
this.scanMetrics.countOfBytesInResults.addAndGet(resultSize);
this.scanMetrics.countOfRowsScanned.incrementAndGet();
}
return result;

View File

@ -205,6 +205,7 @@ public class TableSnapshotInputFormatImpl {
scan.setIsolationLevel(IsolationLevel.READ_UNCOMMITTED);
// disable caching of data blocks
scan.setCacheBlocks(false);
scan.setScanMetricsEnabled(true);
scanner =
new ClientSideRegionScanner(conf, fs, new Path(split.restoreDir), htd, hri, scan, null);