kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From granthe...@apache.org
Subject [3/4] kudu git commit: [test] Clean up MiniKuduCluster and BaseKuduTest
Date Fri, 21 Sep 2018 13:45:35 GMT
http://git-wip-us.apache.org/repos/asf/kudu/blob/fd1ffd0f/java/kudu-flume-sink/src/test/java/org/apache/kudu/flume/sink/RegexpKuduOperationsProducerTest.java
----------------------------------------------------------------------
diff --git a/java/kudu-flume-sink/src/test/java/org/apache/kudu/flume/sink/RegexpKuduOperationsProducerTest.java
b/java/kudu-flume-sink/src/test/java/org/apache/kudu/flume/sink/RegexpKuduOperationsProducerTest.java
index 675760d..8b4c3df 100644
--- a/java/kudu-flume-sink/src/test/java/org/apache/kudu/flume/sink/RegexpKuduOperationsProducerTest.java
+++ b/java/kudu-flume-sink/src/test/java/org/apache/kudu/flume/sink/RegexpKuduOperationsProducerTest.java
@@ -206,7 +206,7 @@ public class RegexpKuduOperationsProducerTest extends BaseKuduTest {
     KuduSink sink = new KuduSink(syncClient);
     HashMap<String, String> parameters = new HashMap<>();
     parameters.put(TABLE_NAME, tableName);
-    parameters.put(MASTER_ADDRESSES, getMasterAddresses());
+    parameters.put(MASTER_ADDRESSES, getMasterAddressesAsString());
     parameters.put(PRODUCER, RegexpKuduOperationsProducer.class.getName());
     parameters.put(PRODUCER_PREFIX + PATTERN_PROP, TEST_REGEXP);
     parameters.put(PRODUCER_PREFIX + OPERATION_PROP, operation);

http://git-wip-us.apache.org/repos/asf/kudu/blob/fd1ffd0f/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITInputFormatJob.java
----------------------------------------------------------------------
diff --git a/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITInputFormatJob.java
b/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITInputFormatJob.java
index 69696e4..cd0e95a 100644
--- a/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITInputFormatJob.java
+++ b/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITInputFormatJob.java
@@ -92,7 +92,7 @@ public class ITInputFormatJob extends BaseKuduTest {
             job,
             TABLE_NAME,
             "*",
-            getMasterAddresses())
+            getMasterAddressesAsString())
             .operationTimeoutMs(DEFAULT_SLEEP)
             .addDependencies(false)
             .cacheBlocks(false)

http://git-wip-us.apache.org/repos/asf/kudu/blob/fd1ffd0f/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITKuduTableInputFormat.java
----------------------------------------------------------------------
diff --git a/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITKuduTableInputFormat.java
b/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITKuduTableInputFormat.java
index 2cfb5cb..3266535 100644
--- a/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITKuduTableInputFormat.java
+++ b/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITKuduTableInputFormat.java
@@ -122,7 +122,7 @@ public class ITKuduTableInputFormat extends BaseKuduTest {
         List<KuduPredicate> predicates) throws IOException, InterruptedException {
     KuduTableInputFormat input = new KuduTableInputFormat();
     Configuration conf = new Configuration();
-    conf.set(KuduTableInputFormat.MASTER_ADDRESSES_KEY, getMasterAddresses());
+    conf.set(KuduTableInputFormat.MASTER_ADDRESSES_KEY, getMasterAddressesAsString());
     conf.set(KuduTableInputFormat.INPUT_TABLE_KEY, TABLE_NAME);
     if (columnProjection != null) {
       conf.set(KuduTableInputFormat.COLUMN_PROJECTION_KEY, columnProjection);

http://git-wip-us.apache.org/repos/asf/kudu/blob/fd1ffd0f/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITKuduTableOutputFormat.java
----------------------------------------------------------------------
diff --git a/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITKuduTableOutputFormat.java
b/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITKuduTableOutputFormat.java
index f97ee0a..597461f 100644
--- a/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITKuduTableOutputFormat.java
+++ b/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITKuduTableOutputFormat.java
@@ -45,7 +45,7 @@ public class ITKuduTableOutputFormat extends BaseKuduTest {
 
     KuduTableOutputFormat output = new KuduTableOutputFormat();
     Configuration conf = new Configuration();
-    conf.set(KuduTableOutputFormat.MASTER_ADDRESSES_KEY, getMasterAddresses());
+    conf.set(KuduTableOutputFormat.MASTER_ADDRESSES_KEY, getMasterAddressesAsString());
     conf.set(KuduTableOutputFormat.OUTPUT_TABLE_KEY, TABLE_NAME);
     output.setConf(conf);
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/fd1ffd0f/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITOutputFormatJob.java
----------------------------------------------------------------------
diff --git a/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITOutputFormatJob.java
b/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITOutputFormatJob.java
index 7b2745b..9c9918d 100644
--- a/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITOutputFormatJob.java
+++ b/java/kudu-mapreduce/src/test/java/org/apache/kudu/mapreduce/ITOutputFormatJob.java
@@ -88,7 +88,7 @@ public class ITOutputFormatJob extends BaseKuduTest {
     new KuduTableMapReduceUtil.TableOutputFormatConfigurator(
         job,
         TABLE_NAME,
-        getMasterAddresses())
+        getMasterAddressesAsString())
         .operationTimeoutMs(DEFAULT_SLEEP)
         .addDependencies(false)
         .configure();

http://git-wip-us.apache.org/repos/asf/kudu/blob/fd1ffd0f/java/kudu-spark-tools/src/test/scala/org/apache/kudu/spark/tools/ITBigLinkedListTest.scala
----------------------------------------------------------------------
diff --git a/java/kudu-spark-tools/src/test/scala/org/apache/kudu/spark/tools/ITBigLinkedListTest.scala
b/java/kudu-spark-tools/src/test/scala/org/apache/kudu/spark/tools/ITBigLinkedListTest.scala
index 01ef8e6..fc01350 100644
--- a/java/kudu-spark-tools/src/test/scala/org/apache/kudu/spark/tools/ITBigLinkedListTest.scala
+++ b/java/kudu-spark-tools/src/test/scala/org/apache/kudu/spark/tools/ITBigLinkedListTest.scala
@@ -37,7 +37,7 @@ class ITBigLinkedListTest extends KuduTestSuite {
         "--hash-partitions=2",
         "--range-partitions=2",
         "--replicas=1",
-        s"--master-addrs=${miniCluster.getMasterAddresses}"
+        s"--master-addrs=${miniCluster.getMasterAddressesAsString}"
       ),
       ss
     )
@@ -76,7 +76,7 @@ class ITBigLinkedListTest extends KuduTestSuite {
     }
 
     val counts = Verifier
-      .testMain(Array(s"--master-addrs=${miniCluster.getMasterAddresses}"), ss)
+      .testMain(Array(s"--master-addrs=${miniCluster.getMasterAddressesAsString}"), ss)
     assertEquals(2 * 2 * 10000, counts.referenced)
     assertEquals(1, counts.extrareferences)
     assertEquals(2, counts.unreferenced)

http://git-wip-us.apache.org/repos/asf/kudu/blob/fd1ffd0f/java/kudu-spark-tools/src/test/scala/org/apache/kudu/spark/tools/TestImportExportFiles.scala
----------------------------------------------------------------------
diff --git a/java/kudu-spark-tools/src/test/scala/org/apache/kudu/spark/tools/TestImportExportFiles.scala
b/java/kudu-spark-tools/src/test/scala/org/apache/kudu/spark/tools/TestImportExportFiles.scala
index d491682..54f801d 100644
--- a/java/kudu-spark-tools/src/test/scala/org/apache/kudu/spark/tools/TestImportExportFiles.scala
+++ b/java/kudu-spark-tools/src/test/scala/org/apache/kudu/spark/tools/TestImportExportFiles.scala
@@ -63,7 +63,7 @@ class TestImportExportFiles extends KuduTestSuite {
       Array(
         "--operation=import",
         "--format=csv",
-        s"--master-addrs=${miniCluster.getMasterAddresses}",
+        s"--master-addrs=${miniCluster.getMasterAddressesAsString}",
         s"--path=$dataPath",
         s"--table-name=$TABLE_NAME",
         "--delimiter=,",

http://git-wip-us.apache.org/repos/asf/kudu/blob/fd1ffd0f/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/DefaultSourceTest.scala
----------------------------------------------------------------------
diff --git a/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/DefaultSourceTest.scala
b/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/DefaultSourceTest.scala
index 9bcd73d..ed56b69 100644
--- a/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/DefaultSourceTest.scala
+++ b/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/DefaultSourceTest.scala
@@ -48,7 +48,8 @@ class DefaultSourceTest extends KuduTestSuite with Matchers {
 
     sqlContext = ss.sqlContext
 
-    kuduOptions = Map("kudu.table" -> tableName, "kudu.master" -> miniCluster.getMasterAddresses)
+    kuduOptions =
+      Map("kudu.table" -> tableName, "kudu.master" -> miniCluster.getMasterAddressesAsString)
 
     sqlContext.read.options(kuduOptions).kudu.createOrReplaceTempView(tableName)
   }
@@ -71,7 +72,7 @@ class DefaultSourceTest extends KuduTestSuite with Matchers {
 
     // now use new options to refer to the new table name
     val newOptions: Map[String, String] =
-      Map("kudu.table" -> tableName, "kudu.master" -> miniCluster.getMasterAddresses)
+      Map("kudu.table" -> tableName, "kudu.master" -> miniCluster.getMasterAddressesAsString)
     val checkDf = sqlContext.read.options(newOptions).kudu
 
     assert(checkDf.schema === df.schema)
@@ -109,7 +110,7 @@ class DefaultSourceTest extends KuduTestSuite with Matchers {
 
     // now use new options to refer to the new table name
     val newOptions: Map[String, String] =
-      Map("kudu.table" -> tableName, "kudu.master" -> miniCluster.getMasterAddresses)
+      Map("kudu.table" -> tableName, "kudu.master" -> miniCluster.getMasterAddressesAsString)
     val checkDf = sqlContext.read.options(newOptions).kudu
 
     assert(checkDf.schema === df.schema)
@@ -194,7 +195,7 @@ class DefaultSourceTest extends KuduTestSuite with Matchers {
     val updateDF = baseDF.withColumn("c2_s", lit("abc"))
     val newOptions: Map[String, String] = Map(
       "kudu.table" -> tableName,
-      "kudu.master" -> miniCluster.getMasterAddresses,
+      "kudu.master" -> miniCluster.getMasterAddressesAsString,
       "kudu.operation" -> "insert",
       "kudu.ignoreDuplicateRowErrors" -> "true")
     updateDF.write.options(newOptions).mode("append").kudu
@@ -226,7 +227,7 @@ class DefaultSourceTest extends KuduTestSuite with Matchers {
     val updateDF = baseDF.withColumn("c2_s", lit("abc"))
     val newOptions: Map[String, String] = Map(
       "kudu.table" -> tableName,
-      "kudu.master" -> miniCluster.getMasterAddresses,
+      "kudu.master" -> miniCluster.getMasterAddressesAsString,
       "kudu.operation" -> "insert-ignore")
     updateDF.write.options(newOptions).mode("append").kudu
 
@@ -311,7 +312,9 @@ class DefaultSourceTest extends KuduTestSuite with Matchers {
 
     val dataDF = sqlContext.read
       .options(
-        Map("kudu.master" -> miniCluster.getMasterAddresses, "kudu.table" -> simpleTableName))
+        Map(
+          "kudu.master" -> miniCluster.getMasterAddressesAsString,
+          "kudu.table" -> simpleTableName))
       .kudu
 
     val nullDF = sqlContext
@@ -343,7 +346,9 @@ class DefaultSourceTest extends KuduTestSuite with Matchers {
 
     val dataDF = sqlContext.read
       .options(
-        Map("kudu.master" -> miniCluster.getMasterAddresses, "kudu.table" -> simpleTableName))
+        Map(
+          "kudu.master" -> miniCluster.getMasterAddressesAsString,
+          "kudu.table" -> simpleTableName))
       .kudu
 
     val nullDF = sqlContext
@@ -351,14 +356,14 @@ class DefaultSourceTest extends KuduTestSuite with Matchers {
       .toDF("key", "val")
     val options_0: Map[String, String] = Map(
       "kudu.table" -> simpleTableName,
-      "kudu.master" -> miniCluster.getMasterAddresses,
+      "kudu.master" -> miniCluster.getMasterAddressesAsString,
       "kudu.ignoreNull" -> "true")
     nullDF.write.options(options_0).mode("append").kudu
     assert(dataDF.collect.toList === nonNullDF.collect.toList)
 
     kuduContext.updateRows(nonNullDF, simpleTableName)
     val options_1: Map[String, String] =
-      Map("kudu.table" -> simpleTableName, "kudu.master" -> miniCluster.getMasterAddresses)
+      Map("kudu.table" -> simpleTableName, "kudu.master" -> miniCluster.getMasterAddressesAsString)
     nullDF.write.options(options_1).mode("append").kudu
     assert(dataDF.collect.toList === nullDF.collect.toList)
 
@@ -403,7 +408,7 @@ class DefaultSourceTest extends KuduTestSuite with Matchers {
   def testTableFaultTolerantScan() {
     kuduOptions = Map(
       "kudu.table" -> tableName,
-      "kudu.master" -> miniCluster.getMasterAddresses,
+      "kudu.master" -> miniCluster.getMasterAddressesAsString,
       "kudu.faultTolerantScan" -> "true")
 
     val table = "faultTolerantScanTest"
@@ -656,7 +661,7 @@ class DefaultSourceTest extends KuduTestSuite with Matchers {
       kuduSession.apply(insert)
     }
     val options: Map[String, String] =
-      Map("kudu.table" -> testTableName, "kudu.master" -> miniCluster.getMasterAddresses)
+      Map("kudu.table" -> testTableName, "kudu.master" -> miniCluster.getMasterAddressesAsString)
     sqlContext.read.options(options).kudu.createOrReplaceTempView(testTableName)
 
     val checkPrefixCount = { prefix: String =>
@@ -719,7 +724,7 @@ class DefaultSourceTest extends KuduTestSuite with Matchers {
         .setNumReplicas(1))
 
     val newOptions: Map[String, String] =
-      Map("kudu.table" -> insertTable, "kudu.master" -> miniCluster.getMasterAddresses)
+      Map("kudu.table" -> insertTable, "kudu.master" -> miniCluster.getMasterAddressesAsString)
     sqlContext.read
       .options(newOptions)
       .kudu
@@ -746,7 +751,7 @@ class DefaultSourceTest extends KuduTestSuite with Matchers {
         .setNumReplicas(1))
 
     val newOptions: Map[String, String] =
-      Map("kudu.table" -> insertTable, "kudu.master" -> miniCluster.getMasterAddresses)
+      Map("kudu.table" -> insertTable, "kudu.master" -> miniCluster.getMasterAddressesAsString)
     sqlContext.read
       .options(newOptions)
       .kudu
@@ -776,7 +781,7 @@ class DefaultSourceTest extends KuduTestSuite with Matchers {
         .setNumReplicas(1))
 
     val newOptions: Map[String, String] =
-      Map("kudu.table" -> newTable, "kudu.master" -> miniCluster.getMasterAddresses)
+      Map("kudu.table" -> newTable, "kudu.master" -> miniCluster.getMasterAddressesAsString)
     df.write.options(newOptions).mode("append").kudu
 
     val checkDf = sqlContext.read.options(newOptions).kudu
@@ -823,7 +828,7 @@ class DefaultSourceTest extends KuduTestSuite with Matchers {
   def testScanLocality() {
     kuduOptions = Map(
       "kudu.table" -> tableName,
-      "kudu.master" -> miniCluster.getMasterAddresses,
+      "kudu.master" -> miniCluster.getMasterAddressesAsString,
       "kudu.scanLocality" -> "closest_replica")
 
     val table = "scanLocalityTest"
@@ -905,7 +910,7 @@ class DefaultSourceTest extends KuduTestSuite with Matchers {
   def testScanRequestTimeoutPropagation() {
     kuduOptions = Map(
       "kudu.table" -> tableName,
-      "kudu.master" -> miniCluster.getMasterAddresses,
+      "kudu.master" -> miniCluster.getMasterAddressesAsString,
       "kudu.scanRequestTimeoutMs" -> "1")
     val dataFrame = sqlContext.read.options(kuduOptions).kudu
     val kuduRelation = kuduRelationFromDataFrame(dataFrame)
@@ -921,7 +926,7 @@ class DefaultSourceTest extends KuduTestSuite with Matchers {
   def testSocketReadTimeoutPropagation() {
     kuduOptions = Map(
       "kudu.table" -> tableName,
-      "kudu.master" -> miniCluster.getMasterAddresses,
+      "kudu.master" -> miniCluster.getMasterAddressesAsString,
       "kudu.socketReadTimeoutMs" -> "1")
     val dataFrame = sqlContext.read.options(kuduOptions).kudu
     val kuduRelation = kuduRelationFromDataFrame(dataFrame)

http://git-wip-us.apache.org/repos/asf/kudu/blob/fd1ffd0f/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/KuduContextTest.scala
----------------------------------------------------------------------
diff --git a/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/KuduContextTest.scala
b/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/KuduContextTest.scala
index 968b6a6..88d0a28 100644
--- a/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/KuduContextTest.scala
+++ b/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/KuduContextTest.scala
@@ -114,7 +114,7 @@ class KuduContextTest extends KuduTestSuite with Matchers {
     insertRows(table, rowCount)
     val sqlContext = ss.sqlContext
     val dataDF = sqlContext.read
-      .options(Map("kudu.master" -> miniCluster.getMasterAddresses, "kudu.table" ->
"test"))
+      .options(Map("kudu.master" -> miniCluster.getMasterAddressesAsString, "kudu.table"
-> "test"))
       .kudu
     dataDF
       .sort("key")

http://git-wip-us.apache.org/repos/asf/kudu/blob/fd1ffd0f/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/KuduTestSuite.scala
----------------------------------------------------------------------
diff --git a/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/KuduTestSuite.scala
b/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/KuduTestSuite.scala
index ed761cc..5b5fc1b 100644
--- a/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/KuduTestSuite.scala
+++ b/java/kudu-spark/src/test/scala/org/apache/kudu/spark/kudu/KuduTestSuite.scala
@@ -135,9 +135,9 @@ trait KuduTestSuite extends JUnitSuite {
 
     ss = SparkSession.builder().config(conf).getOrCreate()
 
-    kuduClient = new KuduClientBuilder(miniCluster.getMasterAddresses).build()
+    kuduClient = new KuduClientBuilder(miniCluster.getMasterAddressesAsString).build()
 
-    kuduContext = new KuduContext(miniCluster.getMasterAddresses, ss.sparkContext)
+    kuduContext = new KuduContext(miniCluster.getMasterAddressesAsString, ss.sparkContext)
 
     table = kuduClient.createTable(tableName, schema, tableOptions)
 


Mime
View raw message