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 176d8bd2c7
commit 0db82daa91
2 changed files with 2 additions and 0 deletions

View File

@ -216,6 +216,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);

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;