HBASE-10461 table.close() in TableEventHandler#reOpenAllRegions() should be enclosed in finally block

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1564184 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2014-02-04 03:48:57 +00:00
parent 9155266fba
commit 5a965b599e
1 changed files with 7 additions and 2 deletions

View File

@ -172,8 +172,13 @@ public abstract class TableEventHandler extends EventHandler {
HTable table = new HTable(masterServices.getConfiguration(), tableName);
TreeMap<ServerName, List<HRegionInfo>> serverToRegions = Maps
.newTreeMap();
NavigableMap<HRegionInfo, ServerName> hriHserverMapping = table.getRegionLocations();
table.close();
NavigableMap<HRegionInfo, ServerName> hriHserverMapping;
try {
hriHserverMapping = table.getRegionLocations();
} finally {
table.close();
}
List<HRegionInfo> reRegions = new ArrayList<HRegionInfo>();
for (HRegionInfo hri : regions) {
ServerName rsLocation = hriHserverMapping.get(hri);