MINOR: Change topic zNode's new reassigning fields names to snake case in order to be consistent with other fields
Reviewers: Colin P. McCabe Ismael Juma
@@ -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(
