HBASE-10176 Canary#sniff() should close the HTable instance

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1553857 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2013-12-28 15:58:59 +00:00
parent ea7734dc90
commit 97ec854f57
1 changed files with 10 additions and 6 deletions

View File

@ -472,13 +472,17 @@ public final class Canary implements Tool {
return;
}
for (HRegionInfo region : admin.getTableRegions(tableDesc.getName())) {
try {
sniffRegion(admin, sink, region, table);
} catch (Exception e) {
sink.publishReadFailure(region, e);
LOG.debug("sniffRegion failed", e);
try {
for (HRegionInfo region : admin.getTableRegions(tableDesc.getName())) {
try {
sniffRegion(admin, sink, region, table);
} catch (Exception e) {
sink.publishReadFailure(region, e);
LOG.debug("sniffRegion failed", e);
}
}
} finally {
table.close();
}
}