Repository: hbase Updated Branches: refs/heads/0.98 1f053b274 -> 38deb4b82 refs/heads/branch-1 a80799a3b -> 600bee44b refs/heads/master 018bbc099 -> 6df18a1b6
Revert "LoadIncrementalHFiles is not picking up the -D option" This reverts commit e05e27f2d52b325765efa5969c934a31303cb66c. Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/cf771b85 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/cf771b85 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/cf771b85 Branch: refs/heads/master Commit: cf771b85a55dafc5c2e8de35bcf187d60923161e Parents: 018bbc0 Author: Matteo Bertozzi <matteo.berto...@cloudera.com> Authored: Thu Aug 21 19:04:33 2014 +0100 Committer: Matteo Bertozzi <matteo.berto...@cloudera.com> Committed: Thu Aug 21 19:04:33 2014 +0100 ---------------------------------------------------------------------- .../hbase/mapreduce/LoadIncrementalHFiles.java | 31 +++++++------------- 1 file changed, 10 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/cf771b85/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java index 3e61d95..a1f79b4 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java @@ -123,26 +123,17 @@ public class LoadIncrementalHFiles extends Configured implements Tool { private String bulkToken; private UserProvider userProvider; - private LoadIncrementalHFiles() {} - public LoadIncrementalHFiles(Configuration conf) throws Exception { super(conf); - initialize(); - } - - private void initialize() throws Exception { - if (hbAdmin == null) { - // make a copy, just to be sure we're not overriding someone else's config - setConf(HBaseConfiguration.create(getConf())); - Configuration conf = getConf(); - // disable blockcache for tool invocation, see HBASE-10500 - conf.setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0); - this.hbAdmin = new HBaseAdmin(conf); - this.userProvider = UserProvider.instantiate(conf); - this.fsDelegationToken = new FsDelegationToken(userProvider, "renewer"); - assignSeqIds = conf.getBoolean(ASSIGN_SEQ_IDS, true); - maxFilesPerRegionPerFamily = conf.getInt(MAX_FILES_PER_REGION_PER_FAMILY, 32); - } + // make a copy, just to be sure we're not overriding someone else's config + setConf(HBaseConfiguration.create(getConf())); + // disable blockcache for tool invocation, see HBASE-10500 + getConf().setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0); + this.hbAdmin = new HBaseAdmin(conf); + this.userProvider = UserProvider.instantiate(conf); + this.fsDelegationToken = new FsDelegationToken(userProvider, "renewer"); + assignSeqIds = conf.getBoolean(ASSIGN_SEQ_IDS, true); + maxFilesPerRegionPerFamily = conf.getInt(MAX_FILES_PER_REGION_PER_FAMILY, 32); } private void usage() { @@ -897,8 +888,6 @@ public class LoadIncrementalHFiles extends Configured implements Tool { return -1; } - initialize(); - String dirPath = args[0]; TableName tableName = TableName.valueOf(args[1]); @@ -914,7 +903,7 @@ public class LoadIncrementalHFiles extends Configured implements Tool { public static void main(String[] args) throws Exception { Configuration conf = HBaseConfiguration.create(); - int ret = ToolRunner.run(conf, new LoadIncrementalHFiles(), args); + int ret = ToolRunner.run(new LoadIncrementalHFiles(conf), args); System.exit(ret); }