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

This commit is contained in:
tedyu 2015-01-13 10:51:56 -08:00
parent e5f3dd682f
commit 72a6a670ac
1 changed files with 5 additions and 3 deletions

View File

@ -933,10 +933,12 @@ public class LoadIncrementalHFiles extends Configured implements Tool {
}
Path hfofDir = new Path(dirPath);
Connection connection = ConnectionFactory.createConnection(getConf());
HTable table = (HTable) connection.getTable(tableName);
doBulkLoad(hfofDir, table);
try (Connection connection = ConnectionFactory.createConnection(getConf());
HTable table = (HTable) connection.getTable(tableName);) {
doBulkLoad(hfofDir, table);
}
return 0;
}