hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r830844 - in /hadoop/hbase/trunk/src: java/org/apache/hadoop/hbase/regionserver/ test/org/apache/hadoop/hbase/regionserver/wal/
Date Thu, 29 Oct 2009 04:42:16 GMT
Author: stack
Date: Thu Oct 29 04:42:15 2009
New Revision: 830844

URL: http://svn.apache.org/viewvc?rev=830844&view=rev
Log:
HBASE-1816 Master rewrite; should have removed safe-mode from regionserver-side too -- Needed
to remove the wait up in top of flush and compactions threads-- used to wait on safe mode...
was stuck there...

Modified:
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
    hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java?rev=830844&r1=830843&r2=830844&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
(original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/CompactSplitThread.java
Thu Oct 29 04:42:15 2009
@@ -70,13 +70,6 @@
   
   @Override
   public void run() {
-    while (!this.server.isStopRequested()) {
-      try {
-        Thread.sleep(this.frequency);
-      } catch (InterruptedException ex) {
-        continue;
-      }
-    }
     int count = 0;
     while (!this.server.isStopRequested()) {
       HRegion r = null;

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=830844&r1=830843&r2=830844&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 Thu
Oct 29 04:42:15 2009
@@ -202,9 +202,6 @@
   // eclipse warning when accessed by inner classes
   protected volatile HLog hlog;
   LogRoller hlogRoller;
-  
-  // limit compactions while starting up
-  CompactionLimitThread compactionLimitThread;
 
   // flag set after we're done setting up server threads (used for testing)
   protected volatile boolean isOnline;
@@ -858,48 +855,6 @@
     return this.fsOk;
   }
 
-  /**
-   * Thread that gradually ups compaction limit.
-   */
-  private class CompactionLimitThread extends Thread {
-    protected CompactionLimitThread() {}
-
-    @Override
-    public void run() {
-      // Slowly increase per-cycle compaction limit, finally setting it to
-      // unlimited (-1)
-      int compactionCheckInterval = 
-        conf.getInt("hbase.regionserver.thread.splitcompactcheckfrequency",
-            20 * 1000);
-      final int limitSteps[] = {
-        1, 1, 1, 1,
-        2, 2, 2, 2, 2, 2,
-        3, 3, 3, 3, 3, 3, 3, 3, 
-        4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-        -1
-      };
-      for (int i = 0; i < limitSteps.length; i++) {
-        // Just log changes.
-        if (compactSplitThread.getLimit() != limitSteps[i] &&
-            LOG.isDebugEnabled()) {
-          LOG.debug("setting compaction limit to " + limitSteps[i]);
-        }
-        compactSplitThread.setLimit(limitSteps[i]);
-        try {
-          Thread.sleep(compactionCheckInterval);
-        } catch (InterruptedException ex) {
-          // unlimit compactions before exiting
-          compactSplitThread.setLimit(-1);
-          if (LOG.isDebugEnabled()) {
-            LOG.debug(this.getName() + " exiting on interrupt");
-          }
-          return;
-        }
-      }
-      LOG.info("compactions no longer limited");
-    }
-  }
-
   /*
    * Thread to shutdown the region server in an orderly manner.  This thread
    * is registered as a shutdown hook in the HRegionServer constructor and is
@@ -1130,10 +1085,6 @@
       } 
     }
 
-    this.compactionLimitThread = new CompactionLimitThread();
-    Threads.setDaemonThreadRunning(this.compactionLimitThread, n +
-      ".compactionLimitThread", handler);
-
     // Start Server.  This service is like leases in that it internally runs
     // a thread.
     this.server.start();
@@ -2083,7 +2034,7 @@
    * @return true if a stop has been requested.
    */
   public boolean isStopRequested() {
-    return stopRequested.get();
+    return this.stopRequested.get();
   }
 
   /**

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=830844&r1=830843&r2=830844&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 Oct 29 04:42:15 2009
@@ -133,16 +133,9 @@
   @Override
   public void run() {
     while (!this.server.isStopRequested()) {
-      try {
-        Thread.sleep(threadWakeFrequency);
-      } catch (InterruptedException ex) {
-        continue;
-      }
-    }
-    while (!server.isStopRequested()) {
       HRegion r = null;
       try {
-        r = flushQueue.poll(threadWakeFrequency, TimeUnit.MILLISECONDS);
+        r = this.flushQueue.poll(this.threadWakeFrequency, TimeUnit.MILLISECONDS);
         if (r == null) {
           continue;
         }
@@ -162,8 +155,8 @@
         }
       }
     }
-    regionsInQueue.clear();
-    flushQueue.clear();
+    this.regionsInQueue.clear();
+    this.flushQueue.clear();
     LOG.info(getName() + " exiting");
   }
   

Modified: hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java?rev=830844&r1=830843&r2=830844&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
(original)
+++ hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
Thu Oct 29 04:42:15 2009
@@ -99,7 +99,6 @@
   private void startAndWriteData() throws Exception {
     // When the META table can be opened, the region servers are running
     new HTable(conf, HConstants.META_TABLE_NAME);
-
     this.server = cluster.getRegionThreads().get(0).getRegionServer();
     this.log = server.getLog();
     
@@ -109,15 +108,12 @@
     HBaseAdmin admin = new HBaseAdmin(conf);
     admin.createTable(desc);
     HTable table = new HTable(conf, tableName);
-
     for (int i = 1; i <= 256; i++) {    // 256 writes should cause 8 log rolls
       Put put = new Put(Bytes.toBytes("row" + String.format("%1$04d", i)));
       put.add(HConstants.CATALOG_FAMILY, null, value);
       table.put(put);
-
       if (i % 32 == 0) {
         // After every 32 writes sleep to let the log roller run
-
         try {
           Thread.sleep(2000);
         } catch (InterruptedException e) {
@@ -126,14 +122,14 @@
       }
     }
   }
-  
+
   /**
    * Tests that logs are deleted
    * 
    * @throws Exception
    */
   public void testLogRolling() throws Exception {
-    tableName = getName();
+    this.tableName = getName();
     try {
       startAndWriteData();
       LOG.info("after writing there are " + log.getNumLogFiles() + " log files");
@@ -158,5 +154,4 @@
       throw e;
     }
   }
-
-}
+}
\ No newline at end of file



Mime
View raw message