chia7712 commented on code in PR #18894:
URL: https://github.com/apache/kafka/pull/18894#discussion_r1955316657


##########
tools/src/main/java/org/apache/kafka/tools/consumer/group/ShareGroupCommand.java:
##########
@@ -263,34 +265,53 @@ TreeMap<String, Entry<ShareGroupDescription, 
Collection<SharePartitionOffsetInfo
             return groupOffsets;
         }
 
-        private void printOffsets(TreeMap<String, Entry<ShareGroupDescription, 
Collection<SharePartitionOffsetInformation>>> offsets) {
+        private void printOffsets(TreeMap<String, Entry<ShareGroupDescription, 
Collection<SharePartitionOffsetInformation>>> offsets, boolean verbose) {
             offsets.forEach((groupId, tuple) -> {
                 ShareGroupDescription description = tuple.getKey();
                 Collection<SharePartitionOffsetInformation> offsetsInfo = 
tuple.getValue();
                 if (maybePrintEmptyGroupState(groupId, 
description.groupState(), offsetsInfo.size())) {
-                    String fmt = printOffsetFormat(groupId, offsetsInfo);
-                    System.out.printf(fmt, "GROUP", "TOPIC", "PARTITION", 
"START-OFFSET");
+                    String fmt = printOffsetFormat(groupId, offsetsInfo, 
verbose);
+
+                    if (verbose) {
+                        System.out.printf(fmt, "GROUP", "TOPIC", "PARTITION", 
"LEADER-EPOCH", "START-OFFSET");

Review Comment:
   Pardon me, are there plans to expand the information provided in verbose 
mode in the future?



##########
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:
   Out of curiosity, why is `null` used to represent "no start offset" instead 
of `-1`? I don't prefer to put `null`, as not all map implementations accept 
null values. Additionally, the `Map#get` method can return `null` even when no 
`null` values have been explicitly added to the map, which effectively conveys 
the absence of a start offset.
   
   please correct me if I misunderstand anything.



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