hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r1090348 - in /hbase/branches/0.90: ./ src/main/java/org/apache/hadoop/hbase/executor/ src/main/java/org/apache/hadoop/hbase/master/handler/ src/test/java/org/apache/hadoop/hbase/executor/ src/test/java/org/apache/hadoop/hbase/replication/ ...
Date Fri, 08 Apr 2011 16:49:21 GMT
Author: jdcryans
Date: Fri Apr  8 16:49:20 2011
New Revision: 1090348

URL: http://svn.apache.org/viewvc?rev=1090348&view=rev
Log:
HBASE-3652  Speed up tests by lowering some sleeps

Modified:
    hbase/branches/0.90/CHANGES.txt
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/executor/EventHandler.java
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/DeleteTableHandler.java
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/DisableTableHandler.java
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java
    hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/executor/TestExecutorService.java
    hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/replication/TestReplication.java
    hbase/branches/0.90/src/test/resources/hbase-site.xml

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1090348&r1=1090347&r2=1090348&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Fri Apr  8 16:49:20 2011
@@ -13,6 +13,7 @@ Release 0.90.3 - Unreleased
    HBASE-3717  deprecate HTable isTableEnabled() methods in favor of HBaseAdmin
                methods (David Butler via Stack)
    HBASE-3747  ReplicationSource should differanciate remote and local exceptions
+   HBASE-3652  Speed up tests by lowering some sleeps
 
   TASK
    HBASE-3748  Add rolling of thrift/rest daemons to graceful_stop.sh script

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/executor/EventHandler.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/executor/EventHandler.java?rev=1090348&r1=1090347&r2=1090348&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/executor/EventHandler.java (original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/executor/EventHandler.java Fri
Apr  8 16:49:20 2011
@@ -70,6 +70,9 @@ public abstract class EventHandler imple
   // Listener to call pre- and post- processing.  May be null.
   private EventHandlerListener listener;
 
+  // Time to wait for events to happen, should be kept short
+  protected final int waitingTimeForEvents;
+
   /**
    * This interface provides pre- and post-process hooks for events.
    */
@@ -143,6 +146,8 @@ public abstract class EventHandler imple
     this.server = server;
     this.eventType = eventType;
     seqid = seqids.incrementAndGet();
+    this.waitingTimeForEvents = server.getConfiguration().
+        getInt("hbase.master.event.waiting.time", 1000);
   }
 
   public void run() {

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/DeleteTableHandler.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/DeleteTableHandler.java?rev=1090348&r1=1090347&r2=1090348&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/DeleteTableHandler.java
(original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/DeleteTableHandler.java
Fri Apr  8 16:49:20 2011
@@ -53,7 +53,7 @@ public class DeleteTableHandler extends 
       while (System.currentTimeMillis() < done) {
         AssignmentManager.RegionState rs = am.isRegionInTransition(region);
         if (rs == null) break;
-        Threads.sleep(1000);
+        Threads.sleep(waitingTimeForEvents);
         LOG.debug("Waiting on  region to clear regions in transition; " + rs);
       }
       if (am.isRegionInTransition(region) != null) {

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/DisableTableHandler.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/DisableTableHandler.java?rev=1090348&r1=1090347&r2=1090348&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/DisableTableHandler.java
(original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/DisableTableHandler.java
Fri Apr  8 16:49:20 2011
@@ -142,7 +142,7 @@ public class DisableTableHandler extends
       long remaining = timeout;
       List<HRegionInfo> regions = null;
       while (!server.isStopped() && remaining > 0) {
-        Thread.sleep(1000);
+        Thread.sleep(waitingTimeForEvents);
         regions = assignmentManager.getRegionsOfTable(tableName);
         if (regions.isEmpty()) break;
         remaining = timeout - (System.currentTimeMillis() - startTime);

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java?rev=1090348&r1=1090347&r2=1090348&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java
(original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java
Fri Apr  8 16:49:20 2011
@@ -164,7 +164,7 @@ public class EnableTableHandler extends 
       long remaining = timeout;
       List<HRegionInfo> regions = null;
       while (!server.isStopped() && remaining > 0) {
-        Thread.sleep(1000);
+        Thread.sleep(waitingTimeForEvents);
         regions = assignmentManager.getRegionsOfTable(tableName);
         if (isDone(regions)) break;
         remaining = timeout - (System.currentTimeMillis() - startTime);

Modified: hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/executor/TestExecutorService.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/executor/TestExecutorService.java?rev=1090348&r1=1090347&r2=1090348&view=diff
==============================================================================
--- hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/executor/TestExecutorService.java
(original)
+++ hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/executor/TestExecutorService.java
Fri Apr  8 16:49:20 2011
@@ -28,10 +28,13 @@ import java.util.concurrent.atomic.Atomi
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.hbase.Server;
 import org.apache.hadoop.hbase.executor.EventHandler.EventType;
 import org.apache.hadoop.hbase.executor.ExecutorService.Executor;
 import org.apache.hadoop.hbase.executor.ExecutorService.ExecutorType;
 import org.junit.Test;
+import static org.mockito.Mockito.*;
 
 public class TestExecutorService {
   private static final Log LOG = LogFactory.getLog(TestExecutorService.class);
@@ -42,6 +45,9 @@ public class TestExecutorService {
     int maxTries = 10;
     int sleepInterval = 10;
 
+    Server mockedServer = mock(Server.class);
+    when(mockedServer.getConfiguration()).thenReturn(HBaseConfiguration.create());
+
     // Start an executor service pool with max 5 threads
     ExecutorService executorService = new ExecutorService("unit_test");
     executorService.startExecutorService(

Modified: hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/replication/TestReplication.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/replication/TestReplication.java?rev=1090348&r1=1090347&r2=1090348&view=diff
==============================================================================
--- hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/replication/TestReplication.java
(original)
+++ hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/replication/TestReplication.java
Fri Apr  8 16:49:20 2011
@@ -96,7 +96,6 @@ public class TestReplication {
     conf1.setLong("replication.source.sleepforretries", 100);
     conf1.setInt("hbase.regionserver.maxlogs", 10);
     conf1.setLong("hbase.master.logcleaner.ttl", 10);
-    conf1.setLong("hbase.client.retries.number", 5);
     conf1.setBoolean(HConstants.REPLICATION_ENABLE_KEY, true);
     conf1.setBoolean("dfs.support.append", true);
     conf1.setLong(HConstants.THREAD_WAKE_FREQUENCY, 100);

Modified: hbase/branches/0.90/src/test/resources/hbase-site.xml
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/test/resources/hbase-site.xml?rev=1090348&r1=1090347&r2=1090348&view=diff
==============================================================================
--- hbase/branches/0.90/src/test/resources/hbase-site.xml (original)
+++ hbase/branches/0.90/src/test/resources/hbase-site.xml Fri Apr  8 16:49:20 2011
@@ -32,13 +32,13 @@
   </property>
   <property>
     <name>hbase.client.pause</name>
-    <value>5000</value>
+    <value>1000</value>
     <description>General client pause value.  Used mostly as value to wait
     before running a retry of a failed get, region lookup, etc.</description>
   </property>
   <property>
     <name>hbase.client.retries.number</name>
-    <value>4</value>
+    <value>10</value>
     <description>Maximum retries.  Used as maximum for all retryable
     operations such as fetching of the root region from root region
     server, getting a cell's value, starting a row update, etc.
@@ -53,6 +53,12 @@
     </description>
   </property>
   <property>
+    <name>hbase.master.event.waiting.time</name>
+    <value>50</value>
+    <description>Time to sleep between checks to see if a table event took place.
+    </description>
+  </property>
+  <property>
     <name>hbase.regionserver.handler.count</name>
     <value>5</value>
     <description>Count of RPC Server instances spun up on RegionServers



Mime
View raw message