dengziming commented on a change in pull request #11936: URL: https://github.com/apache/kafka/pull/11936#discussion_r834991039
########## File path: core/src/main/scala/kafka/tools/GetOffsetShell.scala ########## @@ -135,7 +135,11 @@ object GetOffsetShell { val partitionOffsets = partitionInfos.flatMap { tp => try { val partitionInfo = listOffsetsResult.partitionResult(tp).get - Some((tp, partitionInfo.offset)) + if (partitionInfo.offset != ListOffsetsResponse.UNKNOWN_OFFSET) { + Some((tp, partitionInfo.offset)) + } else { + None Review comment: The previous implement is controlled by KafkaConsumer and we have no ways to change it, however, now we can improve the output since AdminClient give us this information. Here we can either print an info message or print -1 to show this information, printing -1 is more reasonable since it's expected to have no offsets in certain conditions as David commented. Do you think this makes sense? -- 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