HBASE-24884 BulkLoadHFilesTool/LoadIncrementalHFiles should accept -D options from command line parameters (#2275)
Signed-off-by: Peter Somogyi <psomogyi@apache.org>
This commit is contained in:
parent
7335dbc834
commit
00aa3bc9fc
|
@ -146,16 +146,16 @@ public class LoadIncrementalHFiles extends Configured implements Tool {
|
||||||
// above. It is invalid family name.
|
// above. It is invalid family name.
|
||||||
static final String TMP_DIR = ".tmp";
|
static final String TMP_DIR = ".tmp";
|
||||||
|
|
||||||
private final int maxFilesPerRegionPerFamily;
|
private int maxFilesPerRegionPerFamily;
|
||||||
private final boolean assignSeqIds;
|
private boolean assignSeqIds;
|
||||||
private boolean bulkLoadByFamily;
|
private boolean bulkLoadByFamily;
|
||||||
|
|
||||||
// Source delegation token
|
// Source delegation token
|
||||||
private final FsDelegationToken fsDelegationToken;
|
private FsDelegationToken fsDelegationToken;
|
||||||
private final UserProvider userProvider;
|
private UserProvider userProvider;
|
||||||
private final int nrThreads;
|
private int nrThreads;
|
||||||
private AtomicInteger numRetries;
|
private AtomicInteger numRetries;
|
||||||
private final RpcControllerFactory rpcControllerFactory;
|
private RpcControllerFactory rpcControllerFactory;
|
||||||
|
|
||||||
private String bulkToken;
|
private String bulkToken;
|
||||||
|
|
||||||
|
@ -184,7 +184,11 @@ public class LoadIncrementalHFiles extends Configured implements Tool {
|
||||||
public LoadIncrementalHFiles(Configuration conf) {
|
public LoadIncrementalHFiles(Configuration conf) {
|
||||||
// make a copy, just to be sure we're not overriding someone else's config
|
// make a copy, just to be sure we're not overriding someone else's config
|
||||||
super(HBaseConfiguration.create(conf));
|
super(HBaseConfiguration.create(conf));
|
||||||
conf = getConf();
|
initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initialize() {
|
||||||
|
Configuration conf = getConf();
|
||||||
// disable blockcache for tool invocation, see HBASE-10500
|
// disable blockcache for tool invocation, see HBASE-10500
|
||||||
conf.setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0);
|
conf.setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0);
|
||||||
userProvider = UserProvider.instantiate(conf);
|
userProvider = UserProvider.instantiate(conf);
|
||||||
|
@ -1252,10 +1256,10 @@ public class LoadIncrementalHFiles extends Configured implements Tool {
|
||||||
usage();
|
usage();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
// Re-initialize to apply -D options from the command line parameters
|
||||||
|
initialize();
|
||||||
String dirPath = args[0];
|
String dirPath = args[0];
|
||||||
TableName tableName = TableName.valueOf(args[1]);
|
TableName tableName = TableName.valueOf(args[1]);
|
||||||
|
|
||||||
|
|
||||||
if (args.length == 2) {
|
if (args.length == 2) {
|
||||||
return !run(dirPath, tableName).isEmpty() ? 0 : -1;
|
return !run(dirPath, tableName).isEmpty() ? 0 : -1;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue