HBASE-26108 add option to disable scanMetrics in TableSnapshotInputFormat (#3519)
Signed-off-by Anoop Sam John <anoopsamjohn@apache.org>
This commit is contained in:
parent
5ce9339972
commit
68549338d0
|
@ -107,6 +107,14 @@ public class TableSnapshotInputFormatImpl {
|
||||||
public static final String SNAPSHOT_INPUTFORMAT_ROW_LIMIT_PER_INPUTSPLIT =
|
public static final String SNAPSHOT_INPUTFORMAT_ROW_LIMIT_PER_INPUTSPLIT =
|
||||||
"hbase.TableSnapshotInputFormat.row.limit.per.inputsplit";
|
"hbase.TableSnapshotInputFormat.row.limit.per.inputsplit";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to enable scan metrics on Scan, default to true
|
||||||
|
*/
|
||||||
|
public static final String SNAPSHOT_INPUTFORMAT_SCAN_METRICS_ENABLED =
|
||||||
|
"hbase.TableSnapshotInputFormat.scan_metrics.enabled";
|
||||||
|
|
||||||
|
public static final boolean SNAPSHOT_INPUTFORMAT_SCAN_METRICS_ENABLED_DEFAULT = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation class for InputSplit logic common between mapred and mapreduce.
|
* Implementation class for InputSplit logic common between mapred and mapreduce.
|
||||||
*/
|
*/
|
||||||
|
@ -240,7 +248,6 @@ public class TableSnapshotInputFormatImpl {
|
||||||
scan.setIsolationLevel(IsolationLevel.READ_UNCOMMITTED);
|
scan.setIsolationLevel(IsolationLevel.READ_UNCOMMITTED);
|
||||||
// disable caching of data blocks
|
// disable caching of data blocks
|
||||||
scan.setCacheBlocks(false);
|
scan.setCacheBlocks(false);
|
||||||
scan.setScanMetricsEnabled(true);
|
|
||||||
|
|
||||||
scanner =
|
scanner =
|
||||||
new ClientSideRegionScanner(conf, fs, new Path(split.restoreDir), htd, hri, scan, null);
|
new ClientSideRegionScanner(conf, fs, new Path(split.restoreDir), htd, hri, scan, null);
|
||||||
|
@ -381,6 +388,10 @@ public class TableSnapshotInputFormatImpl {
|
||||||
boolean localityEnabled = conf.getBoolean(SNAPSHOT_INPUTFORMAT_LOCALITY_ENABLED_KEY,
|
boolean localityEnabled = conf.getBoolean(SNAPSHOT_INPUTFORMAT_LOCALITY_ENABLED_KEY,
|
||||||
SNAPSHOT_INPUTFORMAT_LOCALITY_ENABLED_DEFAULT);
|
SNAPSHOT_INPUTFORMAT_LOCALITY_ENABLED_DEFAULT);
|
||||||
|
|
||||||
|
boolean scanMetricsEnabled = conf.getBoolean(SNAPSHOT_INPUTFORMAT_SCAN_METRICS_ENABLED,
|
||||||
|
SNAPSHOT_INPUTFORMAT_SCAN_METRICS_ENABLED_DEFAULT);
|
||||||
|
scan.setScanMetricsEnabled(scanMetricsEnabled);
|
||||||
|
|
||||||
List<InputSplit> splits = new ArrayList<>();
|
List<InputSplit> splits = new ArrayList<>();
|
||||||
for (HRegionInfo hri : regionManifests) {
|
for (HRegionInfo hri : regionManifests) {
|
||||||
// load region descriptor
|
// load region descriptor
|
||||||
|
|
Loading…
Reference in New Issue