This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Child pages
  • KIP-350: Allow kafka-topics.sh to take brokerid as parameter to show partitions associated with it
Skip to end of metadata
Go to start of metadata

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