You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2015/07/04 00:03:13 UTC

[3/5] hbase git commit: HBASE-14002 Add --noReplicationSetup option to IntegrationTestReplication

HBASE-14002 Add --noReplicationSetup option to IntegrationTestReplication

Signed-off-by: Andrew Purtell <ap...@apache.org>


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

Branch: refs/heads/branch-1.2
Commit: 23d05e60ef017a1e17408a141fb2c3a21d054d62
Parents: 9daeebb
Author: Dima Spivak <ds...@cloudera.com>
Authored: Thu Jul 2 14:48:06 2015 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Fri Jul 3 14:54:40 2015 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/test/IntegrationTestReplication.java  | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/23d05e60/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestReplication.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestReplication.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestReplication.java
index a56d5fe..c6668ad 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestReplication.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestReplication.java
@@ -63,6 +63,7 @@ public class IntegrationTestReplication extends IntegrationTestBigLinkedList {
   protected int generateVerifyGap;
   protected Integer width;
   protected Integer wrapMultiplier;
+  protected boolean noReplicationSetup = false;
 
   private final String SOURCE_CLUSTER_OPT = "sourceCluster";
   private final String DEST_CLUSTER_OPT = "destCluster";
@@ -70,6 +71,7 @@ public class IntegrationTestReplication extends IntegrationTestBigLinkedList {
   private final String NUM_MAPPERS_OPT = "numMappers";
   private final String OUTPUT_DIR_OPT = "outputDir";
   private final String NUM_REDUCERS_OPT = "numReducers";
+  private final String NO_REPLICATION_SETUP_OPT = "noReplicationSetup";
 
   /**
    * The gap (in seconds) from when data is finished being generated at the source
@@ -318,7 +320,9 @@ public class IntegrationTestReplication extends IntegrationTestBigLinkedList {
       source = new ClusterID(getConf(), sourceClusterIdString);
       sink = new ClusterID(getConf(), sinkClusterIdString);
 
-      setupTablesAndReplication();
+      if (!noReplicationSetup) {
+        setupTablesAndReplication();
+      }
       int expectedNumNodes = 0;
       for (int i = 0; i < numIterations; i++) {
         LOG.info("Starting iteration = " + i);
@@ -348,11 +352,12 @@ public class IntegrationTestReplication extends IntegrationTestBigLinkedList {
     addRequiredOptWithArg("d", OUTPUT_DIR_OPT,
                           "Temporary directory where to write keys for the test");
 
-
     addOptWithArg("nm", NUM_MAPPERS_OPT,
                   "Number of mappers (default: " + DEFAULT_NUM_MAPPERS + ")");
     addOptWithArg("nr", NUM_REDUCERS_OPT,
                   "Number of reducers (default: " + DEFAULT_NUM_MAPPERS + ")");
+    addOptNoArg("nrs", NO_REPLICATION_SETUP_OPT,
+                  "Don't setup tables or configure replication before starting test");
     addOptWithArg("n", NUM_NODES_OPT,
                   "Number of nodes. This should be a multiple of width * wrapMultiplier."  +
                   " (default: " + DEFAULT_NUM_NODES + ")");
@@ -396,6 +401,10 @@ public class IntegrationTestReplication extends IntegrationTestBigLinkedList {
                                                  Integer.toString(DEFAULT_WRAP_MULTIPLIER)),
                               1, Integer.MAX_VALUE);
 
+    if (cmd.hasOption(NO_REPLICATION_SETUP_OPT)) {
+      noReplicationSetup = true;
+    }
+
     if (numNodes % (width * wrapMultiplier) != 0) {
       throw new RuntimeException("numNodes must be a multiple of width and wrap multiplier");
     }