hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r832188 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/regionserver/HRegion.java src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java src/java/org/apache/hadoop/hbase/regionserver/Store.java
Date Mon, 02 Nov 2009 23:28:03 GMT
Author: jdcryans
Date: Mon Nov  2 23:28:02 2009
New Revision: 832188

URL: http://svn.apache.org/viewvc?rev=832188&view=rev
Log:
HBASE-1947  If HBase starts/stops often in less than 24 hours, 
               you end up with lots of store files

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Store.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=832188&r1=832187&r2=832188&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Mon Nov  2 23:28:02 2009
@@ -151,6 +151,8 @@
    HBASE-1943  Remove AgileJSON; unused
    HBASE-1944  Add a "deferred log flush" attribute to HTD
    HBASE-1945  Remove META and ROOT memcache size bandaid 
+   HBASE-1947  If HBase starts/stops often in less than 24 hours, 
+               you end up with lots of store files
 
   OPTIMIZATIONS
    HBASE-410   [testing] Speed up the test suite

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java?rev=832188&r1=832187&r2=832188&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java Mon Nov
 2 23:28:02 2009
@@ -2502,6 +2502,20 @@
   }
 
   /**
+   * Checks every store to see if one has too many
+   * store files
+   * @return true if any store has too many store files
+   */
+  public boolean hasTooManyStoreFiles() {
+    for(Store store : stores.values()) {
+      if(store.hasTooManyStoreFiles()) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  /**
    * Facility for dumping and compacting catalog tables.
    * Only does catalog tables since these are only tables we for sure know
    * schema on.  For usage run:

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=832188&r1=832187&r2=832188&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java Mon
Nov  2 23:28:02 2009
@@ -1428,10 +1428,12 @@
     if (region == null) {
       try {
         region = instantiateRegion(regionInfo);
-        // Startup a compaction early if one is needed, if region has references.
-        if (region.hasReferences()) {
+        // Startup a compaction early if one is needed, if region has references
+        // or if a store has too many store files
+        if (region.hasReferences() || region.hasTooManyStoreFiles()) {
           this.compactSplitThread.compactionRequested(region,
-            "Region has references on open");
+            region.hasReferences() ? "Region has references on open" :
+                                     "Region has too many store files");
         }
       } catch (Throwable e) {
         Throwable t = cleanup(e,

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Store.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Store.java?rev=832188&r1=832187&r2=832188&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Store.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Store.java Mon Nov  2
23:28:02 2009
@@ -1501,6 +1501,15 @@
       this.lock.readLock().unlock();
     }
   }
+
+  /**
+   * See if there's too much store files in this store
+   * @return true if number of store files is greater than
+   *  the number defined in compactionThreshold
+   */
+  public boolean hasTooManyStoreFiles() {
+    return this.storefiles.size() > this.compactionThreshold;
+  }
   
   public static final long FIXED_OVERHEAD = ClassSize.align(
       ClassSize.OBJECT + (17 * ClassSize.REFERENCE) +



Mime
View raw message