Repository: hbase
Updated Branches:
  refs/heads/branch-1 4a803e79e -> e15a803b5


HBASE-12401 Add some timestamp signposts in IntegrationTestMTTR


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/e15a803b
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/e15a803b
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/e15a803b

Branch: refs/heads/branch-1
Commit: e15a803b595164008c1b62e125a6774b0f9af427
Parents: 4a803e7
Author: Nick Dimiduk <[email protected]>
Authored: Fri Oct 31 15:09:18 2014 -0700
Committer: Nick Dimiduk <[email protected]>
Committed: Fri Oct 31 17:22:47 2014 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/mttr/IntegrationTestMTTR.java  | 49 +++++++++++---------
 .../org/apache/hadoop/hbase/HBaseCluster.java   |  5 +-
 2 files changed, 31 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/e15a803b/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java
----------------------------------------------------------------------
diff --git 
a/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java 
b/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java
index 55cc70e..b34eb9e 100644
--- 
a/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java
+++ 
b/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java
@@ -278,6 +278,7 @@ public class IntegrationTestMTTR {
 
   public void run(Callable<Boolean> monkeyCallable, String testName) throws 
Exception {
     int maxIters = util.getHBaseClusterInterface().isDistributedCluster() ? 10 
: 3;
+    LOG.info("Starting " + testName + " with " + maxIters + " iterations.");
 
     // Array to keep track of times.
     ArrayList<TimingResult> resultPuts = new ArrayList<TimingResult>(maxIters);
@@ -285,33 +286,39 @@ public class IntegrationTestMTTR {
     ArrayList<TimingResult> resultAdmin = new 
ArrayList<TimingResult>(maxIters);
     long start = System.nanoTime();
 
-    // We're going to try this multiple times
-    for (int fullIterations = 0; fullIterations < maxIters; fullIterations++) {
-      // Create and start executing a callable that will kill the servers
-      Future<Boolean> monkeyFuture = executorService.submit(monkeyCallable);
+    try {
+      // We're going to try this multiple times
+      for (int fullIterations = 0; fullIterations < maxIters; 
fullIterations++) {
+        // Create and start executing a callable that will kill the servers
+        Future<Boolean> monkeyFuture = executorService.submit(monkeyCallable);
 
-      // Pass that future to the timing Callables.
-      Future<TimingResult> putFuture = executorService.submit(new 
PutCallable(monkeyFuture));
-      Future<TimingResult> scanFuture = executorService.submit(new 
ScanCallable(monkeyFuture));
-      Future<TimingResult> adminFuture = executorService.submit(new 
AdminCallable(monkeyFuture));
+        // Pass that future to the timing Callables.
+        Future<TimingResult> putFuture = executorService.submit(new 
PutCallable(monkeyFuture));
+        Future<TimingResult> scanFuture = executorService.submit(new 
ScanCallable(monkeyFuture));
+        Future<TimingResult> adminFuture = executorService.submit(new 
AdminCallable(monkeyFuture));
 
-      Future<Boolean> loadFuture = executorService.submit(new 
LoadCallable(monkeyFuture));
+        Future<Boolean> loadFuture = executorService.submit(new 
LoadCallable(monkeyFuture));
 
-      monkeyFuture.get();
-      loadFuture.get();
+        monkeyFuture.get();
+        loadFuture.get();
 
-      // Get the values from the futures.
-      TimingResult putTime = putFuture.get();
-      TimingResult scanTime = scanFuture.get();
-      TimingResult adminTime = adminFuture.get();
+        // Get the values from the futures.
+        TimingResult putTime = putFuture.get();
+        TimingResult scanTime = scanFuture.get();
+        TimingResult adminTime = adminFuture.get();
 
-      // Store the times to display later.
-      resultPuts.add(putTime);
-      resultScan.add(scanTime);
-      resultAdmin.add(adminTime);
+        // Store the times to display later.
+        resultPuts.add(putTime);
+        resultScan.add(scanTime);
+        resultAdmin.add(adminTime);
 
-      // Wait some time for everything to settle down.
-      Thread.sleep(5000l);
+        // Wait some time for everything to settle down.
+        Thread.sleep(5000l);
+      }
+    } catch (Exception e) {
+      long runtimeMs = TimeUnit.MILLISECONDS.convert(System.nanoTime() - 
start, TimeUnit.NANOSECONDS);
+      LOG.info(testName + " failed after " + runtimeMs + "ms.", e);
+      throw e;
     }
 
     long runtimeMs = TimeUnit.MILLISECONDS.convert(System.nanoTime() - start, 
TimeUnit.NANOSECONDS);

http://git-wip-us.apache.org/repos/asf/hbase/blob/e15a803b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseCluster.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseCluster.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseCluster.java
index 5865520..76a9566 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseCluster.java
@@ -95,7 +95,7 @@ public abstract class HBaseCluster implements Closeable, 
Configurable {
   }
 
   /**
-   * Returns an {@link MasterAdminService.BlockingInterface} to the active 
master
+   * Returns an {@link MasterService.BlockingInterface} to the active master
    */
   public abstract MasterService.BlockingInterface getMasterAdminService()
   throws IOException;
@@ -150,7 +150,8 @@ public abstract class HBaseCluster implements Closeable, 
Configurable {
       }
       Threads.sleep(100);
     }
-    throw new IOException("did timeout waiting for region server to start:" + 
hostname);
+    throw new IOException("did timeout " + timeout + "ms waiting for region 
server to start: "
+        + hostname);
   }
 
   /**

Reply via email to