hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r794913 - in /hadoop/hbase/trunk_on_hadoop-0.18.3: ./ src/java/org/apache/hadoop/hbase/regionserver/
Date Fri, 17 Jul 2009 00:02:07 GMT
Author: apurtell
Date: Fri Jul 17 00:02:07 2009
New Revision: 794913

URL: http://svn.apache.org/viewvc?rev=794913&view=rev
Log:
HBASE-1583

Modified:
    hadoop/hbase/trunk_on_hadoop-0.18.3/CHANGES.txt
    hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
    hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
    hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java

Modified: hadoop/hbase/trunk_on_hadoop-0.18.3/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk_on_hadoop-0.18.3/CHANGES.txt?rev=794913&r1=794912&r2=794913&view=diff
==============================================================================
--- hadoop/hbase/trunk_on_hadoop-0.18.3/CHANGES.txt (original)
+++ hadoop/hbase/trunk_on_hadoop-0.18.3/CHANGES.txt Fri Jul 17 00:02:07 2009
@@ -272,6 +272,7 @@
                time we cycle the hstore.getStorefilesCount() >
                this.blockingStoreFilesNumber loop
    HBASE-1058  Disable 1058 on catalog tables
+   HBASE-1583  Start/Stop of large cluster untenable
 
   IMPROVEMENTS
    HBASE-1089  Add count of regions on filesystem to master UI; add percentage

Modified: hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java?rev=794913&r1=794912&r2=794913&view=diff
==============================================================================
--- hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
(original)
+++ hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
Fri Jul 17 00:02:07 2009
@@ -26,17 +26,16 @@
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.ReentrantLock;
 
-import org.apache.hadoop.util.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.hbase.client.HTable;
-import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.HBaseConfiguration;
-import org.apache.hadoop.hbase.RemoteExceptionHandler;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.HRegionInfo;
+import org.apache.hadoop.hbase.RemoteExceptionHandler;
+import org.apache.hadoop.hbase.client.HTable;
+import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.util.Writables;
+import org.apache.hadoop.util.StringUtils;
 
 /** 
  * Compact region on request and then run split if appropriate

Modified: hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java?rev=794913&r1=794912&r2=794913&view=diff
==============================================================================
--- hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
(original)
+++ hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
Fri Jul 17 00:02:07 2009
@@ -343,6 +343,20 @@
       " available; sequence id is " + this.minSequenceId);
   }
 
+  /**
+   * @return True if this region has references.
+   */
+  boolean hasReferences() {
+    for (Map.Entry<byte [], Store> e: this.stores.entrySet()) {
+      for (Map.Entry<Long, StoreFile> ee:
+          e.getValue().getStorefiles().entrySet()) {
+        // Found a reference, return.
+        if (ee.getValue().isReference()) return true;
+      }
+    }
+    return false;
+  }
+
   /*
    * Write out an info file under the region directory.  Useful recovering
    * mangled regions.
@@ -747,6 +761,10 @@
    */
   byte [] compactStores(final boolean majorCompaction)
   throws IOException {
+    if (this.closing.get() || this.closed.get()) {
+      LOG.debug("Skipping compaction on " + this + " because closing/closed");
+      return null;
+    }
     splitsAndClosesLock.readLock().lock();
     try {
       byte [] splitRow = null;
@@ -1487,12 +1505,13 @@
   private boolean isFlushSize(final long size) {
     return size > this.memstoreFlushSize;
   }
-  
+
   // Do any reconstruction needed from the log
   protected void doReconstructionLog(Path oldLogFile, long minSeqId, long maxSeqId,
     Progressable reporter)
   throws UnsupportedEncodingException, IOException {
     // Nothing to do (Replaying is done in HStores)
+    // Used by subclasses; e.g. THBase.
   }
 
   protected Store instantiateHStore(Path baseDir, 

Modified: hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=794913&r1=794912&r2=794913&view=diff
==============================================================================
--- hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
(original)
+++ hadoop/hbase/trunk_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Fri Jul 17 00:02:07 2009
@@ -1549,9 +1549,11 @@
     if (region == null) {
       try {
         region = instantiateRegion(regionInfo);
-        // Startup a compaction early if one is needed.
-        this.compactSplitThread.
-          compactionRequested(region, "Region open check");
+        // Startup a compaction early if one is needed, if region has references.
+        if (region.hasReferences()) {
+          this.compactSplitThread.compactionRequested(region,
+            "Region has references on open");
+        }
       } catch (Throwable e) {
         Throwable t = cleanup(e,
           "Error opening " + regionInfo.getRegionNameAsString());



Mime
View raw message