HBASE-3652 Speed up tests by lowering some sleeps
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1090347 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
56efef8f2d
commit
420cbdfd9d
|
@ -183,6 +183,7 @@ Release 0.90.3 - Unreleased
|
|||
|
||||
IMPROVEMENTS
|
||||
HBASE-3747 ReplicationSource should differanciate remote and local exceptions
|
||||
HBASE-3652 Speed up tests by lowering some sleeps
|
||||
|
||||
|
||||
Release 0.90.2 - Unreleased
|
||||
|
|
|
@ -70,6 +70,9 @@ public abstract class EventHandler implements Runnable, Comparable<Runnable> {
|
|||
// 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.
|
||||
*/
|
||||
|
@ -145,6 +148,8 @@ public abstract class EventHandler implements Runnable, Comparable<Runnable> {
|
|||
this.server = server;
|
||||
this.eventType = eventType;
|
||||
seqid = seqids.incrementAndGet();
|
||||
this.waitingTimeForEvents = server.getConfiguration().
|
||||
getInt("hbase.master.event.waiting.time", 1000);
|
||||
}
|
||||
|
||||
public void run() {
|
||||
|
|
|
@ -53,7 +53,7 @@ public class DeleteTableHandler extends TableEventHandler {
|
|||
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) {
|
||||
|
|
|
@ -142,7 +142,7 @@ public class DisableTableHandler extends EventHandler {
|
|||
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);
|
||||
|
|
|
@ -164,7 +164,7 @@ public class EnableTableHandler extends EventHandler {
|
|||
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);
|
||||
|
|
|
@ -28,10 +28,13 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||
|
||||
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(
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
|
@ -52,6 +52,12 @@
|
|||
Used as sleep interval by service threads such as META scanner and log roller.
|
||||
</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>
|
||||
|
|
Loading…
Reference in New Issue