You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by br...@apache.org on 2020/08/19 04:36:39 UTC

[hbase] branch master updated: HBASE-24884 BulkLoadHFilesTool/LoadIncrementalHFiles should accept -D options from command line parameters (#2260)

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

brfrn169 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 1164531  HBASE-24884 BulkLoadHFilesTool/LoadIncrementalHFiles should accept -D options from command line parameters (#2260)
1164531 is described below

commit 1164531d5ab519ab58af82ba3849f8fcded3453f
Author: Toshihiro Suzuki <br...@gmail.com>
AuthorDate: Wed Aug 19 13:36:17 2020 +0900

    HBASE-24884 BulkLoadHFilesTool/LoadIncrementalHFiles should accept -D options from command line parameters (#2260)
    
    Signed-off-by: Peter Somogyi <ps...@apache.org>
---
 .../apache/hadoop/hbase/tool/BulkLoadHFilesTool.java    | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/BulkLoadHFilesTool.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/BulkLoadHFilesTool.java
index e8b701b..6c62a3d 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/BulkLoadHFilesTool.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/BulkLoadHFilesTool.java
@@ -129,14 +129,14 @@ public class BulkLoadHFilesTool extends Configured implements BulkLoadHFiles, To
   // above. It is invalid family name.
   static final String TMP_DIR = ".tmp";
 
-  private final int maxFilesPerRegionPerFamily;
-  private final boolean assignSeqIds;
+  private int maxFilesPerRegionPerFamily;
+  private boolean assignSeqIds;
   private boolean bulkLoadByFamily;
 
   // Source delegation token
-  private final FsDelegationToken fsDelegationToken;
-  private final UserProvider userProvider;
-  private final int nrThreads;
+  private FsDelegationToken fsDelegationToken;
+  private UserProvider userProvider;
+  private int nrThreads;
   private final AtomicInteger numRetries = new AtomicInteger(0);
   private String bulkToken;
 
@@ -146,6 +146,11 @@ public class BulkLoadHFilesTool extends Configured implements BulkLoadHFiles, To
   public BulkLoadHFilesTool(Configuration conf) {
     // make a copy, just to be sure we're not overriding someone else's config
     super(new Configuration(conf));
+    initialize();
+  }
+
+  public void initialize() {
+    Configuration conf = getConf();
     // disable blockcache for tool invocation, see HBASE-10500
     conf.setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0);
     userProvider = UserProvider.instantiate(conf);
@@ -1073,6 +1078,8 @@ public class BulkLoadHFilesTool extends Configured implements BulkLoadHFiles, To
       usage();
       return -1;
     }
+    // Re-initialize to apply -D options from the command line parameters
+    initialize();
     Path dirPath = new Path(args[0]);
     TableName tableName = TableName.valueOf(args[1]);
     if (args.length == 2) {