kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmcc...@apache.org
Subject [kafka] branch 2.4 updated: MINOR: Change topic zNode's new reassigning fields names to snake case in order to be consistent with other fields (#7458)
Date Wed, 09 Oct 2019 18:49:51 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/2.4 by this push:
     new 48b58e0  MINOR: Change topic zNode's new reassigning fields names to snake case in
order to be consistent with other fields (#7458)
48b58e0 is described below

commit 48b58e03481d4b7faec2d1906abb21729e01faf8
Author: Stanislav Kozlovski <stanislav_kozlovski@outlook.com>
AuthorDate: Wed Oct 9 19:47:29 2019 +0100

    MINOR: Change topic zNode's new reassigning fields names to snake case in order to be
consistent with other fields (#7458)
    
    Reviewers: Colin P. McCabe <cmccabe@apache.org>, Ismael Juma <ismael@juma.me.uk>
    (cherry picked from commit 4c01668f7725d4057d3ff09ad9898c15e2899892)
---
 core/src/main/scala/kafka/zk/ZkData.scala | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/core/src/main/scala/kafka/zk/ZkData.scala b/core/src/main/scala/kafka/zk/ZkData.scala
index 75d169d..4a81e83 100644
--- a/core/src/main/scala/kafka/zk/ZkData.scala
+++ b/core/src/main/scala/kafka/zk/ZkData.scala
@@ -256,8 +256,8 @@ object TopicZNode {
     Json.encodeAsBytes(Map(
       "version" -> 2,
       "partitions" -> replicaAssignmentJson.asJava,
-      "addingReplicas" -> addingReplicasAssignmentJson.asJava,
-      "removingReplicas" -> removingReplicasAssignmentJson.asJava
+      "adding_replicas" -> addingReplicasAssignmentJson.asJava,
+      "removing_replicas" -> removingReplicasAssignmentJson.asJava
     ).asJava)
   }
   def decode(topic: String, bytes: Array[Byte]): Map[TopicPartition, PartitionReplicaAssignment]
= {
@@ -274,8 +274,8 @@ object TopicZNode {
     Json.parseBytes(bytes).flatMap { js =>
       val assignmentJson = js.asJsonObject
       val partitionsJsonOpt = assignmentJson.get("partitions").map(_.asJsonObject)
-      val addingReplicasJsonOpt = assignmentJson.get("addingReplicas").map(_.asJsonObject)
-      val removingReplicasJsonOpt = assignmentJson.get("removingReplicas").map(_.asJsonObject)
+      val addingReplicasJsonOpt = assignmentJson.get("adding_replicas").map(_.asJsonObject)
+      val removingReplicasJsonOpt = assignmentJson.get("removing_replicas").map(_.asJsonObject)
       partitionsJsonOpt.map { partitionsJson =>
         partitionsJson.iterator.map { case (partition, replicas) =>
           new TopicPartition(topic, partition.toInt) -> PartitionReplicaAssignment(


Mime
View raw message