Repository: hbase Updated Branches: refs/heads/branch-1 b79dbedad -> 908779b88
HBASE-12849 LoadIncrementalHFiles should use unmanaged connection in branch-1 Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/908779b8 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/908779b8 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/908779b8 Branch: refs/heads/branch-1 Commit: 908779b88701a6d06366a3693d688c1ad1a40417 Parents: b79dbed Author: tedyu <[email protected]> Authored: Tue Jan 13 10:55:07 2015 -0800 Committer: tedyu <[email protected]> Committed: Tue Jan 13 10:55:07 2015 -0800 ---------------------------------------------------------------------- .../apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/908779b8/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 c5af937..b6e8d9c 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 @@ -47,6 +47,7 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceStability; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Connection; +import org.apache.hadoop.hbase.client.ConnectionFactory; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.client.HConnection; import org.apache.hadoop.hbase.client.HTable; @@ -931,9 +932,11 @@ public class LoadIncrementalHFiles extends Configured implements Tool { } Path hfofDir = new Path(dirPath); - HTable table = new HTable(getConf(), tableName); - doBulkLoad(hfofDir, table); + try (Connection connection = ConnectionFactory.createConnection(getConf()); + HTable table = (HTable) connection.getTable(tableName);) { + doBulkLoad(hfofDir, table); + } return 0; }
