artemlivshits commented on code in PR #20039: URL: https://github.com/apache/kafka/pull/20039#discussion_r2181095646
########## clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java: ########## @@ -29,6 +29,7 @@ import org.apache.kafka.clients.producer.internals.BufferPool; import org.apache.kafka.clients.producer.internals.BuiltInPartitioner; import org.apache.kafka.clients.producer.internals.KafkaProducerMetrics; +import org.apache.kafka.clients.producer.internals.PreparedTxnState; Review Comment: This is public class, it shouldn't be in internals. ########## clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java: ########## @@ -349,7 +348,7 @@ public synchronized void prepareTransaction() { maybeFailWithError(); transitionTo(State.PREPARED_TRANSACTION); this.preparedTxnState = new PreparedTxnState( - this.producerIdAndEpoch.producerId + ":" + + this.producerIdAndEpoch.producerId, Review Comment: Let's just change the type of `preparedTxnState` member to be `private volatile ProducerIdAndEpoch preparedTxnState` then we can just assign numbers to it (it even has a convenient `NONE` constant). Then the `KafkaProducer` would create the corresponding `PreparedTxnState` object. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org