hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1351052 - /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Date Sun, 17 Jun 2012 05:40:03 GMT
Author: stack
Date: Sun Jun 17 05:40:03 2012
New Revision: 1351052

URL: http://svn.apache.org/viewvc?rev=1351052&view=rev
Log:
Backport HBASE-5998 to 94.1

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=1351052&r1=1351051&r2=1351052&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Sun Jun 17 05:40:03 2012
@@ -2697,10 +2697,16 @@ public class HRegionServer implements HR
   throws IOException {
     return openRegion(region, -1);
   }
+
   @Override
   @QosPriority(priority = HIGH_QOS)
   public RegionOpeningState openRegion(HRegionInfo region, int versionOfOfflineNode)
       throws IOException {
+    return openRegion(region, versionOfOfflineNode, null);
+  }
+
+  private RegionOpeningState openRegion(HRegionInfo region, int versionOfOfflineNode,
+      Map<String, HTableDescriptor> htds) throws IOException {
     checkOpen();
     checkIfRegionInTransition(region, OPEN);
     HRegion onlineRegion = this.getFromOnlineRegions(region.getEncodedName());
@@ -2721,7 +2727,16 @@ public class HRegionServer implements HR
     }
     LOG.info("Received request to open region: " +
       region.getRegionNameAsString());
-    HTableDescriptor htd = this.tableDescriptors.get(region.getTableName());
+    HTableDescriptor htd = null;
+    if (htds == null) {
+      htd = this.tableDescriptors.get(region.getTableName());
+    } else {
+      htd = htds.get(region.getTableNameAsString());
+      if (htd == null) {
+        htd = this.tableDescriptors.get(region.getTableName());
+        htds.put(region.getRegionNameAsString(), htd);
+      }
+    }
     this.regionsInTransitionInRS.putIfAbsent(region.getEncodedNameAsBytes(),
         true);
     // Need to pass the expected version in the constructor.
@@ -2757,7 +2772,8 @@ public class HRegionServer implements HR
   throws IOException {
     checkOpen();
     LOG.info("Received request to open " + regions.size() + " region(s)");
-    for (HRegionInfo region: regions) openRegion(region);
+    Map<String, HTableDescriptor> htds = new HashMap<String, HTableDescriptor>(regions.size());
+    for (HRegionInfo region : regions) openRegion(region, -1, htds);
   }
 
   @Override



Mime
View raw message