kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject [kafka] branch trunk updated: MINOR: Fix broken standalone ReplicationQuotasTestRig test (#5773)
Date Wed, 10 Oct 2018 20:18:08 GMT
This is an automated email from the ASF dual-hosted git repository.

ijuma pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 34f029e  MINOR: Fix broken standalone ReplicationQuotasTestRig test (#5773)
34f029e is described below

commit 34f029e3dc30d8a7b0f1f1ec639d16a4e1fb4cbf
Author: Manikumar Reddy O <manikumar.reddy@gmail.com>
AuthorDate: Thu Oct 11 01:48:00 2018 +0530

    MINOR: Fix broken standalone ReplicationQuotasTestRig test (#5773)
    
    * Fix `ZkUtils.getReassignmentJson` to pass Java map to `Json.encodeAsString`
    * Allow new file creation in ReplicationQuotasTestRig test
    
    Reviewers: Ismael Juma <ismael@juma.me.uk>
---
 core/src/main/scala/kafka/utils/ZkUtils.scala                  | 8 ++++----
 core/src/test/scala/other/kafka/ReplicationQuotasTestRig.scala | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/core/src/main/scala/kafka/utils/ZkUtils.scala b/core/src/main/scala/kafka/utils/ZkUtils.scala
index d47af0d..331f7bb 100644
--- a/core/src/main/scala/kafka/utils/ZkUtils.scala
+++ b/core/src/main/scala/kafka/utils/ZkUtils.scala
@@ -175,10 +175,10 @@ object ZkUtils {
         Map(
           "topic" -> tp.topic,
           "partition" -> tp.partition,
-          "replicas" -> replicas
-        )
-      }
-    ))
+          "replicas" -> replicas.asJava
+        ).asJava
+      }.asJava
+    ).asJava)
   }
 }
 
diff --git a/core/src/test/scala/other/kafka/ReplicationQuotasTestRig.scala b/core/src/test/scala/other/kafka/ReplicationQuotasTestRig.scala
index 470ee4d..9c6ae0b 100644
--- a/core/src/test/scala/other/kafka/ReplicationQuotasTestRig.scala
+++ b/core/src/test/scala/other/kafka/ReplicationQuotasTestRig.scala
@@ -15,7 +15,7 @@
   * limitations under the License.
   */
 
-package other.kafka
+package kafka
 
 import java.io.{File, PrintWriter}
 import java.nio.file.{Files, StandardOpenOption}
@@ -311,7 +311,7 @@ object ReplicationQuotasTestRig {
     }
 
     def append(message: String): Unit = {
-      val stream = Files.newOutputStream(log.toPath, StandardOpenOption.APPEND)
+      val stream = Files.newOutputStream(log.toPath, StandardOpenOption.CREATE, StandardOpenOption.APPEND)
       new PrintWriter(stream) {
         append(message)
         close


Mime
View raw message