HBASE-12849 LoadIncrementalHFiles should use unmanaged connection in branch-1

This commit is contained in:
tedyu 2015-01-13 10:55:07 -08:00
parent b79dbedad6
commit 908779b887
1 changed files with 5 additions and 2 deletions

View File

@ -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;
}