kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: MINOR: Improve output format of `kafka_reassign_partitions.sh` tool
Date Thu, 22 Dec 2016 00:25:34 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 7599d5d78 -> 8ff5a9f3c


MINOR: Improve output format of `kafka_reassign_partitions.sh` tool

The current output for the `--generate` option looks like this

```
Current partition replica assignment

{"version":1,"partitions":[{"topic":"t1","partition":0,"replicas":[0]}]}
Proposed partition reassignment configuration

{"version":1,"partitions":[{"topic":"t1","partition":0,"replicas":[1]}]}
```

This PR simply changes it to

```
Current partition replica assignment
{"version":1,"partitions":[{"topic":"t1","partition":0,"replicas":[0]}]}

Proposed partition reassignment configuration
{"version":1,"partitions":[{"topic":"t1","partition":0,"replicas":[1]}]}
```

to make it more readable.

Author: Vahid Hashemian <vahidhashemian@us.ibm.com>

Reviewers: Guozhang Wang <wangguoz@gmail.com>

Closes #1868 from vahidhashemian/minor/improve_output_format_of_reassign_partitions


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/8ff5a9f3
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/8ff5a9f3
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/8ff5a9f3

Branch: refs/heads/trunk
Commit: 8ff5a9f3cf1765674e21dc35e9d7570816954e25
Parents: 7599d5d
Author: Vahid Hashemian <vahidhashemian@us.ibm.com>
Authored: Wed Dec 21 16:25:28 2016 -0800
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Wed Dec 21 16:25:28 2016 -0800

----------------------------------------------------------------------
 core/src/main/scala/kafka/admin/ReassignPartitionsCommand.scala | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/8ff5a9f3/core/src/main/scala/kafka/admin/ReassignPartitionsCommand.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/admin/ReassignPartitionsCommand.scala b/core/src/main/scala/kafka/admin/ReassignPartitionsCommand.scala
index 709b365..4fcd548 100755
--- a/core/src/main/scala/kafka/admin/ReassignPartitionsCommand.scala
+++ b/core/src/main/scala/kafka/admin/ReassignPartitionsCommand.scala
@@ -116,8 +116,8 @@ object ReassignPartitionsCommand extends Logging {
     val topicsToMoveJsonString = Utils.readFileAsString(topicsToMoveJsonFile)
     val disableRackAware = opts.options.has(opts.disableRackAware)
     val (proposedAssignments, currentAssignments) = generateAssignment(zkUtils, brokerListToReassign,
topicsToMoveJsonString, disableRackAware)
-    println("Current partition replica assignment\n\n%s".format(ZkUtils.formatAsReassignmentJson(currentAssignments)))
-    println("Proposed partition reassignment configuration\n\n%s".format(ZkUtils.formatAsReassignmentJson(proposedAssignments)))
+    println("Current partition replica assignment\n%s\n".format(ZkUtils.formatAsReassignmentJson(currentAssignments)))
+    println("Proposed partition reassignment configuration\n%s".format(ZkUtils.formatAsReassignmentJson(proposedAssignments)))
   }
 
   def generateAssignment(zkUtils: ZkUtils, brokerListToReassign: Seq[Int], topicsToMoveJsonString:
String, disableRackAware: Boolean): (Map[TopicAndPartition, Seq[Int]], Map[TopicAndPartition,
Seq[Int]]) = {


Mime
View raw message