hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1564184 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/TableEventHandler.java
Date Tue, 04 Feb 2014 03:48:58 GMT
Author: tedyu
Date: Tue Feb  4 03:48:57 2014
New Revision: 1564184

URL: http://svn.apache.org/r1564184
Log:
HBASE-10461 table.close() in TableEventHandler#reOpenAllRegions() should be enclosed in finally
block


Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/TableEventHandler.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/TableEventHandler.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/TableEventHandler.java?rev=1564184&r1=1564183&r2=1564184&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/TableEventHandler.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/TableEventHandler.java
Tue Feb  4 03:48:57 2014
@@ -172,8 +172,13 @@ public abstract class TableEventHandler 
     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);



Mime
View raw message