Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

MINOR: Use TransactionOperation enum instead of String for pending state checks #21218

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

Open
chickenchickenlove wants to merge 1 commit into apache:trunk
base: trunk
Choose a base branch
Loading
from chickenchickenlove:251229-no-issue

Conversation

@chickenchickenlove
Copy link
Contributor

@chickenchickenlove chickenchickenlove commented Dec 29, 2025
edited
Loading

PR Description

this PR refactors TransactionManager#throwIfPendingState to use a typed TransactionOperation enum instead of a raw String.

###Background / Motivation
The previous String-based API relies on manually passing operation names, which can make it easier for naming to drift or become inconsistent over time. Using an enum makes the intent more explicit and keeps the operation naming centralized.

What’s changed

  • Added a TransactionOperation enum with a displayName (and toString() override) to preserve readable exception messages.
  • Updated relevant call sites (beginTransaction, prepareTransaction, sendOffsetsToTransaction, maybeAddPartition) to pass the corresponding enum value.
  • Updated throwIfPendingState to accept TransactionOperation instead of String.

Behavior / Compatibility

  • No behavioral change is intended. The exception message remains human-readable and consistent via TransactionOperation#toString().

Testing

No additional tests were added since this is a small refactor; existing tests should continue to cover the pending-transition behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /