hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r790766 - /hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/HMaster.java
Date Fri, 03 Jul 2009 00:08:51 GMT
Author: stack
Date: Fri Jul  3 00:08:51 2009
New Revision: 790766

URL: http://svn.apache.org/viewvc?rev=790766&view=rev
Log:
HBASE-1602 HRegionServer won't go down since we added in new LruBlockCache

Modified:
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/HMaster.java

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/HMaster.java?rev=790766&r1=790765&r2=790766&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/HMaster.java Fri Jul  3 00:08:51
2009
@@ -271,6 +271,12 @@
   private void bootstrap() throws IOException {
     LOG.info("BOOTSTRAP: creating ROOT and first META regions");
     try {
+      // Bootstrapping, make sure blockcache is off.  Else, one will be
+      // created here in bootstap and it'll need to be cleaned up.  Better to
+      // not make it in first place.  Turn off block caching for bootstrap.
+      // Enable after.
+      setBlockCaching(HRegionInfo.ROOT_REGIONINFO, false);
+      setBlockCaching(HRegionInfo.FIRST_META_REGIONINFO, false);
       HRegion root = HRegion.createHRegion(HRegionInfo.ROOT_REGIONINFO,
         this.rootdir, this.conf);
       HRegion meta = HRegion.createHRegion(HRegionInfo.FIRST_META_REGIONINFO,
@@ -281,6 +287,8 @@
       root.getLog().closeAndDelete();
       meta.close();
       meta.getLog().closeAndDelete();
+      setBlockCaching(HRegionInfo.ROOT_REGIONINFO, true);
+      setBlockCaching(HRegionInfo.FIRST_META_REGIONINFO, true);
     } catch (IOException e) {
       e = RemoteExceptionHandler.checkIOException(e);
       LOG.error("bootstrap", e);
@@ -288,6 +296,16 @@
     }
   }
 
+  /*
+   * @param hri Set all family block caching to <code>b</code>
+   * @param b
+   */
+  private void setBlockCaching(final HRegionInfo hri, final boolean b) {
+    for (HColumnDescriptor hcd: hri.getTableDesc().families.values()) {
+      hcd.setBlockCacheEnabled(b);
+    }
+  }
+
   /**
    * Checks to see if the file system is still accessible.
    * If not, sets closed



Mime
View raw message