You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by hu...@apache.org on 2021/07/22 18:20:56 UTC

[hbase] branch master updated: HBASE-26108 add option to disable scanMetrics in TableSnapshotInputFormat (#3516)

This is an automated email from the ASF dual-hosted git repository.

huaxiangsun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new d15f3cb  HBASE-26108 add option to disable scanMetrics in TableSnapshotInputFormat (#3516)
d15f3cb is described below

commit d15f3cbea37a9027653a151e47177bfd59a6a3a9
Author: huaxiangsun <hu...@apache.org>
AuthorDate: Thu Jul 22 11:20:15 2021 -0700

    HBASE-26108 add option to disable scanMetrics in TableSnapshotInputFormat (#3516)
    
    Signed-off-by Anoop Sam John <an...@apache.org>
---
 .../hbase/mapreduce/TableSnapshotInputFormatImpl.java       | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatImpl.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatImpl.java
index c9e3f68..abdd8f4 100644
--- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatImpl.java
+++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableSnapshotInputFormatImpl.java
@@ -108,6 +108,14 @@ public class TableSnapshotInputFormatImpl {
       "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.
    */
   public static class InputSplit implements Writable {
@@ -240,7 +248,6 @@ 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);
@@ -381,6 +388,10 @@ public class TableSnapshotInputFormatImpl {
     boolean localityEnabled = conf.getBoolean(SNAPSHOT_INPUTFORMAT_LOCALITY_ENABLED_KEY,
                                               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<>();
     for (RegionInfo hri : regionManifests) {
       // load region descriptor