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: Replace enum name with state name to fix ConsumerGroupDescription.state() #18315

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

dongnuo123
Copy link
Collaborator

groupState.name() returns the name of the enum while ConsumerGroupState#parse uses the state name.

Committer Checklist (excluded from commit message)

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

@github-actions github-actions bot added triage PRs from the community clients small Small PRs labels Dec 24, 2024
@ijuma
Copy link
Contributor

ijuma commented Dec 24, 2024

Can we add a test for this please?

@ijuma
Copy link
Contributor

ijuma commented Dec 24, 2024

Also, is this also broken in the 4.0 branch? If so, let's note that a cherry-pick to 4.0 is also required.

@dongnuo123
Copy link
Collaborator Author

Also, is this also broken in the 4.0 branch? If so, let's note that a cherry-pick to 4.0 is also required.

it's also broken. I'll open a cherry-pick pr once this is merged. https://github.com/apache/kafka/blob/4.0/clients/src/main/java/org/apache/kafka/clients/admin/ConsumerGroupDescription.java#L187

@jolshan
Copy link
Member

jolshan commented Dec 24, 2024

@dongnuo123 looks like the import order needs to be fixed.

@dongnuo123
Copy link
Collaborator Author

dongnuo123 commented Dec 24, 2024

@jolshan Could you trigger the build again?
I think there is a ci-approved label to always trigger the build

@chia7712
Copy link
Member

@dongnuo123 nice find. We need to replace ".name()" by ".toString" as well:

return groupState.map(state0 -> ConsumerGroupState.parse(state0.name()));

return groupStates.stream().map(groupState -> ConsumerGroupState.parse(groupState.name())).collect(Collectors.toSet());

return groupStates.stream().map(groupState -> ConsumerGroupState.parse(groupState.name())).collect(Collectors.toSet());

this(groupId, Objects.requireNonNull(state).map(state0 -> GroupState.parse(state0.name())), Optional.empty(), isSimpleConsumerGroup);

this(groupId, Objects.requireNonNull(state).map(state0 -> GroupState.parse(state0.name())), type, isSimpleConsumerGroup);

@TaiJuWu
Copy link
Contributor

TaiJuWu commented Dec 25, 2024

I notice there is something make our CI hanging bit I think it is not related this PR.
https://github.com/apache/kafka/actions/runs/12486596513/job/34847313711?pr=18315#step:11:1301

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-approved clients small Small PRs triage PRs from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants