KAFKA-9479: Print describe --state header once for multiple groups#22301
KAFKA-9479: Print describe --state header once for multiple groups#22301Hana1025 wants to merge 3 commits into
Conversation
When describing multiple consumer groups with --state (including --all-groups), compute column widths across all groups and print the header once.
|
@Hana1025 |
Extract coordinator formatting helper and add a test that verifies the state header is printed only once when describing multiple groups.
Data rows do not contain the COORDINATOR (ID) header label. Use explicit --group flags and count non-blank lines instead.
@smjn Thanks for the review. Sample output for kafka-consumer-groups.sh --describe --state is below (using --bootstrap-server localhost:9092). No consumer groups (--all-groups on a cluster with no groups) printStates returns immediately when there are no printable groups. Single group (--group group1 --state) GROUP COORDINATOR (ID) ASSIGNMENT-STRATEGY STATE #MEMBERS GROUP COORDINATOR (ID) ASSIGNMENT-STRATEGY STATE #MEMBERS GROUP COORDINATOR (ID) ASSIGNMENT-STRATEGY STATE #MEMBERS Also pushed commit b7db1be with a regression test that asserts the state header is printed only once for multiple --group --state. |
|
A label of 'needs-attention' was automatically added to this PR in order to raise the |
When describing multiple consumer groups with --state (including
--all-groups), compute column widths across all groups and print the
header once.