Skip to content

MINOR: Move TransactionStateManager leaf case classes to Java records in transaction-coordinator#22334

Open
sjhajharia wants to merge 2 commits into
apache:trunkfrom
sjhajharia:move-txn-leafs
Open

MINOR: Move TransactionStateManager leaf case classes to Java records in transaction-coordinator#22334
sjhajharia wants to merge 2 commits into
apache:trunkfrom
sjhajharia:move-txn-leafs

Conversation

@sjhajharia
Copy link
Copy Markdown
Collaborator

@sjhajharia sjhajharia commented May 20, 2026

Summary

As part of the larger effort to move TransactionStateManager from core
to the transaction-coordinator module and convert it to Java, this PR
extracts the 7 leaf data classes that lived inside
TransactionStateManager.scala and reimplements them as Java records in
org.apache.kafka.coordinator.transaction. They have no coupling to the
manager itself and can move independently.

Changes

New Java records in transaction-coordinator:

  • TransactionPartitionAndLeaderEpoch
  • TransactionalIdAndProducerIdEpoch : custom toString preserved (used in
    log messages)
  • CoordinatorEpochAndTxnMetadata
  • TransactionalIdCoordinatorEpochAndMetadata
  • TransactionalIdCoordinatorEpochAndTransitMetadata
  • TxnMetadataCacheEntry : custom toString preserved (coordinatorEpoch=X,
    numTransactionalEntries=Y)
  • TransactionConfig : declares a no-arg constructor that delegates to
    the canonical 11-arg constructor with the same *_DEFAULT constants the
    old Scala defaults referenced, preserving the TransactionConfig() test
    ergonomics

Removed from TransactionStateManager.scala: all 7 case class
definitions; unused ServerConfigs import.

Call-site updates:

  • TransactionStateManager.scala, TransactionCoordinator.scala : added
    imports, prepended new to record construction.
  • 5 test files: TransactionStateManagerTest, TransactionCoordinatorTest,
    TransactionCoordinatorConcurrencyTest,
    TransactionMarkerRequestCompletionHandlerTest,
    TransactionMarkerChannelManagerTest : same treatment.

@github-actions github-actions Bot added core Kafka Broker transactions Transactions and EOS triage PRs from the community labels May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-approved core Kafka Broker transactions Transactions and EOS triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant