AndrewJSchofield commented on code in PR #18894:
URL: https://github.com/apache/kafka/pull/18894#discussion_r1955794920
##########
tools/src/main/java/org/apache/kafka/tools/consumer/group/ShareGroupCommand.java:
##########
@@ -250,7 +252,7 @@ TreeMap<String, Entry<ShareGroupDescription,
Collection<SharePartitionOffsetInfo
groupId,
tp.getKey().topic(),
tp.getKey().partition(),
- earliestResult.get(tp.getKey())
+
Optional.ofNullable(earliestResult.get(tp.getKey()))
Review Comment:
I have analysed how `Admin.listConsumerGroupOffsets` behaves and copied
that. I want someone with code that works with consumer groups to be able to
move across to share groups with minimal friction. Conceptually, I agree with
you, but I went with consistency. It's modelled on
`ListConsumerGroupOffsetsResult`.
I think there are two cases here. First, there might have been an error
(most likely `TOPIC_AUTHORIZATION_FAILED`) for a particular requested
topic-partition. Second, there might not have been an error, but there is no
offset information. Both of these are `null`. Both "you cannot know the offset"
and "there is no offset".
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]