Status

Current state: Under Discussion

Discussion thread: here

JIRA: here

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

Currently with kafka-topics.sh if we want to get the list of partitions associated with a specific broker irrespective of whether it is leader or replica, we pipe the output and then do grep on it.

To make it easier I am proposing the change to add option in TopicCommand.scala to pass the broker id.


Public Interfaces

Add optional argument "brokerid" to kafka-topics.sh adding below in TopicCommand.scal

parser.accepts("brokerid", "Broker id to list the partitions hosted on it, irrespective of whether it is leader or replica")
                       .withRequiredArg
                       .describedAs("Broker id")
                       .ofType(classOf[Int])
                       .defaultsTo(-1)


Proposed Changes

When "--brokerid" is specified by user, the given brokerid will be used by kafka-topic.sh and will only show the partitions associated with the given broker id irrespective of whether it is leader or replica.


  • No labels