Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MINOR: Fix broken output layout of kafka-consumer-groups.sh #17058

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

sasakitoa
Copy link
Contributor

Output format of kafka-consumer-groups.sh with --delete-offsets or --reset-offsets has been broken since line separators are missing.
This PR will fix the problem.

--
Current:

$ kafka-consumer-groups.sh --bootstrap-server localhost:9092 --delete-offsets --topic topic1 --group TestGroup1
Request succeed for deleting offsets with topic topic1 group TestGroup1

TOPIC                          PARTITION       STATUS         topic1                         0               Successful     topic1                         1               Successful     topic1                         2               Successful     topic1                         3               Successful     topic1                         4               Successful     topic1                         5               Successful     topic1                         6               Successful     topic1                         7               Successful     topic1                         8               Successful     topic1                         9               Successful     

Expect:

$ kafka-consumer-groups.sh --bootstrap-server localhost:9092 --delete-offsets --topic topic1 --group TestGroup1             
Request succeed for deleting offsets with topic topic1 group TestGroup1

TOPIC                          PARTITION       STATUS         
topic1                         0               Successful     
topic1                         1               Successful     
topic1                         2               Successful     
topic1                         3               Successful     
topic1                         4               Successful     
topic1                         5               Successful     
topic1                         6               Successful     
topic1                         7               Successful     
topic1                         8               Successful     
topic1                         9               Successful     

--
Current:

$ kafka-consumer-groups.sh --bootstrap-server localhost:9092 --reset-offsets --from-file /tmp/offsets.csv --group TestGroup1 --execute

GROUP                          TOPIC                          PARTITION  NEW-OFFSET     TestGroup1                     topic1                         1          20             TestGroup1                     topic1                         0          10             TestGroup1                     topic1                         3          40             TestGroup1                     topic1                         2          30             TestGroup1                     topic1                         5          60             TestGroup1                     topic1                         4          50             

Expect:

$ kafka-consumer-groups.sh --bootstrap-server localhost:9092 --reset-offsets --from-file /tmp/offsets.csv --group TestGroup1 --execute

GROUP                          TOPIC                          PARTITION  NEW-OFFSET     
TestGroup1                     topic1                         1          20             
TestGroup1                     topic1                         0          10             
TestGroup1                     topic1                         3          40             
TestGroup1                     topic1                         2          30             
TestGroup1                     topic1                         5          60             
TestGroup1                     topic1                         4          50         

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

Copy link
Contributor

@AndrewJSchofield AndrewJSchofield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I built and tried out the patch and it looks good to me.

Copy link
Collaborator

@lianetm lianetm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this @sasakitoa! Played with it locally and looks good to me, very nice improvement indeed.

@lianetm
Copy link
Collaborator

lianetm commented Sep 4, 2024

Hey @sasakitoa, could you please fix the spotbugs failures? you can re-run it with ./gradlew :tools:spotbugsMain to see the details. Thanks!

@sasakitoa
Copy link
Contributor Author

Thank you for reviewing and advising.
I fixed it and passed SpotBugs test locally.

@lianetm lianetm merged commit 748d202 into apache:trunk Sep 4, 2024
5 of 6 checks passed
@lianetm
Copy link
Collaborator

lianetm commented Sep 4, 2024

Thanks for the fix @sasakitoa! (All builds completed with unrelated failures)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants