HBASE-18473 VC.listLabels() erroneously closes any connection.

This commit is contained in:
anoopsamjohn 2017-07-30 14:49:38 +05:30
parent 2d06a06ba4
commit 5c47cb5d49
1 changed files with 1 additions and 11 deletions

View File

@ -259,9 +259,7 @@ public class VisibilityClient {
*/
public static ListLabelsResponse listLabels(Connection connection, final String regex)
throws Throwable {
Table table = null;
try {
table = connection.getTable(LABELS_TABLE_NAME);
try (Table table = connection.getTable(LABELS_TABLE_NAME)) {
Batch.Call<VisibilityLabelsService, ListLabelsResponse> callable =
new Batch.Call<VisibilityLabelsService, ListLabelsResponse>() {
ServerRpcController controller = new ServerRpcController();
@ -289,14 +287,6 @@ public class VisibilityClient {
return result.values().iterator().next(); // There will be exactly one region for labels
// table and so one entry in result Map.
}
finally {
if (table != null) {
table.close();
}
if (connection != null) {
connection.close();
}
}
}
/**