lucasbru commented on code in PR #18911:
URL: https://github.com/apache/kafka/pull/18911#discussion_r1963792617


##########
tools/src/main/java/org/apache/kafka/tools/streams/StreamsGroupCommand.java:
##########
@@ -307,6 +336,43 @@ Map<TopicPartition, Long> 
getOffsets(Collection<StreamsGroupMemberDescription> m
             return lag;
         }
 
+        Map<TopicPartition, OffsetsAndLag> getOffsets2(StreamsGroupDescription 
description) throws ExecutionException, InterruptedException {
+            final Collection<StreamsGroupMemberDescription> members = 
description.members();
+            Set<TopicPartition> allTp = new HashSet<>();
+            for (StreamsGroupMemberDescription memberDescription : members) {
+                
allTp.addAll(getTopicPartitions(memberDescription.assignment().activeTasks(), 
description));
+            }
+            // fetch latest and earliest offsets
+            Map<TopicPartition, OffsetSpec> earliest = new HashMap<>();
+            Map<TopicPartition, OffsetSpec> latest = new HashMap<>();
+
+            for (TopicPartition tp : allTp) {
+                earliest.put(tp, OffsetSpec.earliest());
+                latest.put(tp, OffsetSpec.latest());
+            }
+            Map<TopicPartition, ListOffsetsResult.ListOffsetsResultInfo> 
earliestResult = adminClient.listOffsets(earliest).all().get();
+            Map<TopicPartition, ListOffsetsResult.ListOffsetsResultInfo> 
latestResult = adminClient.listOffsets(latest).all().get();
+            Map<TopicPartition, OffsetAndMetadata> committedOffsets = 
getCommittedOffsets(description.groupId());
+
+            Map<TopicPartition, OffsetsAndLag> output = new HashMap<>();

Review Comment:
    We did have the leader-epoch before, and it should be returned by 
`getCommittedOffsets`, couldn't we include it in the verbose output? I guess my 
ask is just to whatever consumer groups do, unless we have a good reason to do 
soemthing different. Inconsistency in the command-line tools in Kafka is a 
major pain already



-- 
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]

Reply via email to