hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r794867 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
Date Thu, 16 Jul 2009 21:29:05 GMT
Author: stack
Date: Thu Jul 16 21:29:05 2009
New Revision: 794867

URL: http://svn.apache.org/viewvc?rev=794867&view=rev
Log:
HBASE-1664 Disable 1058 on catalog tables

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=794867&r1=794866&r2=794867&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Thu Jul 16 21:29:05 2009
@@ -270,6 +270,7 @@
    HBASE-1663  Request compaction only once instead of every time 500ms each
                time we cycle the hstore.getStorefilesCount() >
                this.blockingStoreFilesNumber loop
+   HBASE-1058  Disable 1058 on catalog tables
 
   IMPROVEMENTS
    HBASE-1089  Add count of regions on filesystem to master UI; add percentage

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java?rev=794867&r1=794866&r2=794867&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
(original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
Thu Jul 16 21:29:05 2009
@@ -222,41 +222,7 @@
    * not flushed.
    */
   private boolean flushRegion(HRegion region, boolean removeFromQueue) {
-    int count = 0;
-    boolean triggered = false;
-    boolean finished = false;
-    while (count++ < (blockingWaitTime / 500)) {
-      finished = true;
-      for (Store hstore: region.stores.values()) {
-        if (hstore.getStorefilesCount() > this.blockingStoreFilesNumber) {
-          // only log once
-          if (!triggered) {
-            LOG.info("Too many store files for region " + region + ": " +
-              hstore.getStorefilesCount() + ", requesting compaction and " +
-              "waiting");
-            this.server.compactSplitThread.compactionRequested(region, getName());
-            triggered = true;
-          }
-          // pending compaction, not finished
-          finished = false;
-          try {
-            Thread.sleep(500);
-          } catch (InterruptedException e) {
-            // ignore
-          }
-        }
-      }
-      if (triggered && finished) {
-        LOG.info("Compaction has completed, we waited " + (count * 500) + "ms, "
-            + "finishing flush of region " + region);
-        break;
-      }
-    }
-    if (triggered && !finished) {
-      LOG.warn("Tried to hold up flushing for compactions of region " + region +
-          " but have waited longer than " + blockingWaitTime + "ms, continuing");
-    }
-
+    checkStoreFileCount(region);
     synchronized (regionsInQueue) {
       // See comment above for removeFromQueue on why we do not
       // take the region out of the set. If removeFromQueue is true, remove it
@@ -297,7 +263,53 @@
 
     return true;
   }
-  
+
+  /*
+   * If too many store files already, schedule a compaction and pause a while
+   * before going on with compaction.
+   * @param region Region to check.
+   */
+  private void checkStoreFileCount(final HRegion region) {
+    // If catalog region, do not ever hold up writes (isMetaRegion returns
+    // true if ROOT or META region).
+    if (region.getRegionInfo().isMetaRegion()) return;
+
+    int count = 0;
+    boolean triggered = false;
+    boolean finished = false;
+    while (count++ < (blockingWaitTime / 500)) {
+      finished = true;
+      for (Store hstore: region.stores.values()) {
+        if (hstore.getStorefilesCount() > this.blockingStoreFilesNumber) {
+          // only log once
+          if (!triggered) {
+            LOG.info("Too many store files for region " + region + ": " +
+              hstore.getStorefilesCount() + ", requesting compaction and " +
+              "waiting");
+            this.server.compactSplitThread.compactionRequested(region, getName());
+            triggered = true;
+          }
+          // pending compaction, not finished
+          finished = false;
+          try {
+            Thread.sleep(500);
+          } catch (InterruptedException e) {
+            // ignore
+          }
+        }
+      }
+      if (triggered && finished) {
+        LOG.info("Compaction has completed, we waited " + (count * 500) + "ms, "
+            + "finishing flush of region " + region);
+        break;
+      }
+    }
+    if (triggered && !finished) {
+      LOG.warn("Tried to hold up flushing for compactions of region " + region +
+          " but have waited longer than " + blockingWaitTime + "ms, continuing");
+    }
+  }
+
   /**
    * Check if the regionserver's memstore memory usage is greater than the 
    * limit. If so, flush regions with the biggest memstores until we're down



Mime
View raw message