You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2021/08/17 00:15:25 UTC

[hbase] branch master updated: HBASE-24842 make export snapshot report size can be config (#2233)

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

stack 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 dc8196f  HBASE-24842 make export snapshot report size can be config (#2233)
dc8196f is described below

commit dc8196faf4873516d8d7325516f01ad4cdf13166
Author: Yechao Chen <ch...@gmail.com>
AuthorDate: Tue Aug 17 08:15:00 2021 +0800

    HBASE-24842 make export snapshot report size can be config (#2233)
    
    Signed-off-by: stack <st...@apache.org>
---
 .../main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java
index c5650c3..42881be 100644
--- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java
+++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java
@@ -112,6 +112,7 @@ public class ExportSnapshot extends AbstractHBaseTool implements Tool {
   private static final String CONF_OUTPUT_ROOT = "snapshot.export.output.root";
   private static final String CONF_INPUT_ROOT = "snapshot.export.input.root";
   private static final String CONF_BUFFER_SIZE = "snapshot.export.buffer.size";
+  private static final String CONF_REPORT_SIZE = "snapshot.export.report.size";
   private static final String CONF_MAP_GROUP = "snapshot.export.default.map.group";
   private static final String CONF_BANDWIDTH_MB = "snapshot.export.map.bandwidth.mb";
   private static final String CONF_MR_JOB_NAME = "mapreduce.job.name";
@@ -172,6 +173,7 @@ public class ExportSnapshot extends AbstractHBaseTool implements Tool {
     private String filesUser;
     private short filesMode;
     private int bufferSize;
+    private int reportSize;
 
     private FileSystem outputFs;
     private Path outputArchive;
@@ -219,6 +221,7 @@ public class ExportSnapshot extends AbstractHBaseTool implements Tool {
       int defaultBlockSize = Math.max((int) outputFs.getDefaultBlockSize(outputRoot), BUFFER_SIZE);
       bufferSize = conf.getInt(CONF_BUFFER_SIZE, defaultBlockSize);
       LOG.info("Using bufferSize=" + StringUtils.humanReadableInt(bufferSize));
+      reportSize = conf.getInt(CONF_REPORT_SIZE, REPORT_SIZE);
 
       for (Counter c : Counter.values()) {
         context.getCounter(c).increment(0);
@@ -423,7 +426,7 @@ public class ExportSnapshot extends AbstractHBaseTool implements Tool {
           totalBytesWritten += bytesRead;
           reportBytes += bytesRead;
 
-          if (reportBytes >= REPORT_SIZE) {
+          if (reportBytes >= reportSize) {
             context.getCounter(Counter.BYTES_COPIED).increment(reportBytes);
             context.setStatus(String.format(statusMessage,
                               StringUtils.humanReadableInt(totalBytesWritten),