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 11:12:02 UTC
[hbase] branch branch-2.2 updated: HBASE-24884
BulkLoadHFilesTool/LoadIncrementalHFiles should accept -D options from
command line parameters (#2275)
This is an automated email from the ASF dual-hosted git repository.
brfrn169 pushed a commit to branch branch-2.2
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.2 by this push:
new 0b4c9f1 HBASE-24884 BulkLoadHFilesTool/LoadIncrementalHFiles should accept -D options from command line parameters (#2275)
0b4c9f1 is described below
commit 0b4c9f17ffc8bd172f98176a13db30825061a801
Author: Toshihiro Suzuki <br...@gmail.com>
AuthorDate: Wed Aug 19 19:55:34 2020 +0900
HBASE-24884 BulkLoadHFilesTool/LoadIncrementalHFiles should accept -D options from command line parameters (#2275)
Signed-off-by: Peter Somogyi <ps...@apache.org>
---
.../hadoop/hbase/tool/LoadIncrementalHFiles.java | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/LoadIncrementalHFiles.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/LoadIncrementalHFiles.java
index f96562a..5a4b979 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/LoadIncrementalHFiles.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/LoadIncrementalHFiles.java
@@ -143,16 +143,16 @@ public class LoadIncrementalHFiles extends Configured implements Tool {
// 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 AtomicInteger numRetries;
- private final RpcControllerFactory rpcControllerFactory;
+ private RpcControllerFactory rpcControllerFactory;
private String bulkToken;
@@ -181,7 +181,11 @@ public class LoadIncrementalHFiles extends Configured implements Tool {
public LoadIncrementalHFiles(Configuration conf) {
// make a copy, just to be sure we're not overriding someone else's config
super(HBaseConfiguration.create(conf));
- conf = getConf();
+ 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);
@@ -1248,10 +1252,10 @@ public class LoadIncrementalHFiles extends Configured implements Tool {
usage();
return -1;
}
+ // Re-initialize to apply -D options from the command line parameters
+ initialize();
String dirPath = args[0];
TableName tableName = TableName.valueOf(args[1]);
-
-
if (args.length == 2) {
return !run(dirPath, tableName).isEmpty() ? 0 : -1;
} else {