hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-12874 LoadIncrementalHFiles should use unmanaged connection
Date Sat, 17 Jan 2015 01:17:37 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.0 409d9a169 -> 5f9a2a314


HBASE-12874 LoadIncrementalHFiles should use unmanaged connection


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/5f9a2a31
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5f9a2a31
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5f9a2a31

Branch: refs/heads/branch-1.0
Commit: 5f9a2a314e2d2feabea56a38cdb08ce0df3e1cda
Parents: 409d9a1
Author: tedyu <yuzhihong@gmail.com>
Authored: Fri Jan 16 17:17:23 2015 -0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Fri Jan 16 17:17:23 2015 -0800

----------------------------------------------------------------------
 .../apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/5f9a2a31/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 55d20f4..81f7bdc 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
@@ -65,6 +65,8 @@ import org.apache.hadoop.hbase.KeyValueUtil;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.TableNotFoundException;
 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;
@@ -925,9 +927,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;
   }
 


Mime
View raw message