kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [1/3] incubator-kudu git commit: [java] Remove the option to test with remote cluster
Date Fri, 22 Jan 2016 23:05:21 GMT
Repository: incubator-kudu
Updated Branches:
  refs/heads/master 77d101b74 -> 05add04e1


[java] Remove the option to test with remote cluster

I added this option years ago to be able to run the java unit tests
from my MBPr, but it's not needed anymore. Also the last time I tried
it I saw it was broken, usually around the parts where we try to kill
nodes.

Change-Id: I3c0136d6af4f0b4066ef94d603e35cbc4a55e4cb
Reviewed-on: http://gerrit.cloudera.org:8080/1874
Reviewed-by: Dan Burkert <dan@cloudera.com>
Tested-by: Internal Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/4edf27fd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/4edf27fd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/4edf27fd

Branch: refs/heads/master
Commit: 4edf27fd62bfb90469022082b85f25439fd0d809
Parents: 77d101b
Author: Jean-Daniel Cryans <jdcryans@cloudera.com>
Authored: Fri Jan 22 08:27:11 2016 -0800
Committer: Adar Dembo <adar@cloudera.com>
Committed: Fri Jan 22 21:14:19 2016 +0000

----------------------------------------------------------------------
 .../java/org/kududb/client/BaseKuduTest.java    | 28 ++++++--------------
 .../org/kududb/client/TestLeaderFailover.java   |  4 ---
 .../test/java/org/kududb/client/TestUtils.java  | 15 -----------
 3 files changed, 8 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/4edf27fd/java/kudu-client/src/test/java/org/kududb/client/BaseKuduTest.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/BaseKuduTest.java b/java/kudu-client/src/test/java/org/kududb/client/BaseKuduTest.java
index 3721e27..d1a1410 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/BaseKuduTest.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/BaseKuduTest.java
@@ -45,9 +45,6 @@ public class BaseKuduTest {
 
   private static final Logger LOG = LoggerFactory.getLogger(BaseKuduTest.class);
 
-  private static final int DEFAULT_MASTER_RPC_PORT = 7051;
-  private static final String START_CLUSTER = "startCluster";
-
   private static final String NUM_MASTERS_PROP = "NUM_MASTERS";
   private static final int NUM_TABLET_SERVERS = 3;
   private static final int DEFAULT_NUM_MASTERS = 1;
@@ -70,7 +67,6 @@ public class BaseKuduTest {
   protected static KuduClient syncClient;
   protected static Schema basicSchema = getBasicSchema();
   protected static Schema allTypesSchema = getSchemaWithAllTypes();
-  protected static boolean startCluster;
 
   private static List<String> tableNames = new ArrayList<>();
 
@@ -78,19 +74,13 @@ public class BaseKuduTest {
   public static void setUpBeforeClass() throws Exception {
     LOG.info("Setting up before class...");
 
-    startCluster = Boolean.parseBoolean(System.getProperty(START_CLUSTER, "true"));
-
-    if (startCluster) {
-      miniCluster = new MiniKuduCluster.MiniKuduClusterBuilder()
-          .numMasters(NUM_MASTERS)
-          .numTservers(NUM_TABLET_SERVERS)
-          .build();
-      masterAddresses = miniCluster.getMasterAddresses();
-      masterHostPorts = miniCluster.getMasterHostPorts();
-    } else {
-      masterAddresses = TestUtils.getMasterAddresses();
-      masterHostPorts = NetUtil.parseStrings(masterAddresses, DEFAULT_MASTER_RPC_PORT);
-    }
+    miniCluster = new MiniKuduCluster.MiniKuduClusterBuilder()
+        .numMasters(NUM_MASTERS)
+        .numTservers(NUM_TABLET_SERVERS)
+        .build();
+    masterAddresses = miniCluster.getMasterAddresses();
+    masterHostPorts = miniCluster.getMasterHostPorts();
+
     LOG.info("Creating new Kudu client...");
     client = new AsyncKuduClient.AsyncKuduClientBuilder(masterAddresses).build();
     syncClient = new KuduClient(client);
@@ -128,9 +118,7 @@ public class BaseKuduTest {
         // shutting down the async client effectively does that.
       }
     } finally {
-      if (startCluster) {
-        miniCluster.shutdown();
-      }
+      miniCluster.shutdown();
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/4edf27fd/java/kudu-client/src/test/java/org/kududb/client/TestLeaderFailover.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestLeaderFailover.java b/java/kudu-client/src/test/java/org/kududb/client/TestLeaderFailover.java
index 1be3652..544feab 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestLeaderFailover.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestLeaderFailover.java
@@ -45,10 +45,6 @@ public class TestLeaderFailover extends BaseKuduTest {
    */
   @Test(timeout = 100000)
   public void testFailover() throws Exception {
-    if (!startCluster) {
-      return;
-    }
-
     KuduSession session = syncClient.newSession();
     session.setIgnoreAllDuplicateRows(true);
     for (int i = 0; i < 3; i++) {

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/4edf27fd/java/kudu-client/src/test/java/org/kududb/client/TestUtils.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/test/java/org/kududb/client/TestUtils.java b/java/kudu-client/src/test/java/org/kududb/client/TestUtils.java
index 39f8518..f4866b8 100644
--- a/java/kudu-client/src/test/java/org/kududb/client/TestUtils.java
+++ b/java/kudu-client/src/test/java/org/kududb/client/TestUtils.java
@@ -49,10 +49,6 @@ public class TestUtils {
   private static String UNIX_PROCESS_CLS_NAME =  "java.lang.UNIXProcess";
   private static Set<String> VALID_SIGNALS =  ImmutableSet.of("STOP", "CONT", "TERM",
"KILL");
 
-  private static final String MASTER_ADDRESSES_PROP = "masterAddresses";
-  private static final String MASTER_ADDRESS_PROP = "masterAddress";
-  private static final String DEFAULT_MASTER_ADDRESS = "127.0.0.1";
-
   private static final String BIN_DIR_PROP = "binDir";
 
   /**
@@ -83,17 +79,6 @@ public class TestUtils {
   }
 
   /**
-   * @return the comma-separated list of addresses for the master(s)
-   */
-  public static String getMasterAddresses() {
-    String addr = System.getProperty(MASTER_ADDRESSES_PROP);
-    if (addr == null) {
-      addr = System.getProperty(MASTER_ADDRESS_PROP, DEFAULT_MASTER_ADDRESS);
-    }
-    return addr;
-  }
-
-  /**
    * Return the path portion of a file URL, after decoding the escaped
    * components. This fixes issues when trying to build within a
    * working directory with special characters.


Mime
View raw message