hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject git commit: HBASE-12367 Integration tests should not restore the cluster if the CM is not destructive
Date Wed, 29 Oct 2014 00:11:11 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 64b6109ce -> 42ed215c2


HBASE-12367 Integration tests should not restore the cluster if the CM is not destructive


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

Branch: refs/heads/master
Commit: 42ed215c2d29d455646a324707f4c7b2ad925ab1
Parents: 64b6109
Author: Enis Soztutar <enis@apache.org>
Authored: Tue Oct 28 17:10:50 2014 -0700
Committer: Enis Soztutar <enis@apache.org>
Committed: Tue Oct 28 17:10:50 2014 -0700

----------------------------------------------------------------------
 .../test/java/org/apache/hadoop/hbase/IntegrationTestBase.java | 3 +++
 .../org/apache/hadoop/hbase/chaos/monkies/CalmChaosMonkey.java | 5 +++++
 .../org/apache/hadoop/hbase/chaos/monkies/ChaosMonkey.java     | 6 ++++++
 .../hadoop/hbase/chaos/monkies/PolicyBasedChaosMonkey.java     | 6 ++++++
 4 files changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/42ed215c/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBase.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBase.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBase.java
index 085c252..f45fb04 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBase.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBase.java
@@ -178,6 +178,9 @@ public abstract class IntegrationTestBase extends AbstractHBaseTool {
   public abstract void setUpCluster() throws Exception;
 
   public void cleanUpCluster() throws Exception {
+    if (util.isDistributedCluster() &&  (monkey == null || !monkey.isDestructive()))
{
+      noClusterCleanUp = true;
+    }
     if (noClusterCleanUp) {
       LOG.debug("noClusterCleanUp is set, skip restoring the cluster");
       return;

http://git-wip-us.apache.org/repos/asf/hbase/blob/42ed215c/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/CalmChaosMonkey.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/CalmChaosMonkey.java
b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/CalmChaosMonkey.java
index bcf45dd..bcf7d85 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/CalmChaosMonkey.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/CalmChaosMonkey.java
@@ -41,4 +41,9 @@ public class CalmChaosMonkey extends ChaosMonkey {
   public void waitForStop() throws InterruptedException {
 
   }
+
+  @Override
+  public boolean isDestructive() {
+    return false;
+  }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/42ed215c/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/ChaosMonkey.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/ChaosMonkey.java
b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/ChaosMonkey.java
index da75c3b..86cbfe5 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/ChaosMonkey.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/ChaosMonkey.java
@@ -51,4 +51,10 @@ public abstract class ChaosMonkey implements Stoppable {
   public abstract boolean isStopped();
 
   public abstract void waitForStop() throws InterruptedException;
+
+  /**
+   * Returns whether the CM does destructive actions (killing servers) so that a cluster
restore
+   * is needed after CM is stopped. Otherwise cluster will be left as it is
+   */
+  public abstract boolean isDestructive();
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/42ed215c/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/PolicyBasedChaosMonkey.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/PolicyBasedChaosMonkey.java
b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/PolicyBasedChaosMonkey.java
index f42f903..9152cb2 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/PolicyBasedChaosMonkey.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/PolicyBasedChaosMonkey.java
@@ -149,4 +149,10 @@ public class PolicyBasedChaosMonkey extends ChaosMonkey {
       monkeyThread.join();
     }
   }
+
+  @Override
+  public boolean isDestructive() {
+    // TODO: we can look at the actions, and decide to do the restore cluster or not based
on them.
+    return true;
+  }
 }


Mime
View raw message