You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ij...@apache.org on 2018/10/10 20:18:08 UTC

[kafka] branch trunk updated: MINOR: Fix broken standalone ReplicationQuotasTestRig test (#5773)

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 <ma...@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 <is...@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