dengziming commented on a change in pull request #11173: URL: https://github.com/apache/kafka/pull/11173#discussion_r691845925
########## File path: core/src/main/scala/kafka/tools/GetOffsetShell.scala ########## @@ -224,9 +227,14 @@ object GetOffsetShell { /** * Return the partition infos. Filter them with topicPartitionFilter. */ - private def listPartitionInfos(consumer: KafkaConsumer[_, _], topicPartitionFilter: PartitionInfo => Boolean): Seq[PartitionInfo] = { - consumer.listTopics.asScala.values.flatMap { partitions => - partitions.asScala.filter(topicPartitionFilter) + private def listPartitionInfos(client: Admin, topicPartitionFilter: PartitionInfo => Boolean, listInternal: Boolean): Seq[PartitionInfo] = { + val topics = client.listTopics(new ListTopicsOptions().listInternal(listInternal)).names().get().asScala Review comment: I changed the method from creating a topic-partition filter to create a topic filter and a topic-partition filter, the topic filter is used to filter topics before fetching and the topic-partition filter is used to filter topic-partitions after receiving topic metadata. PTAL. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org