chickenchickenlove opened a new pull request, #21218: URL: https://github.com/apache/kafka/pull/21218
### PR Description Hi all, 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. -- 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]
