wernerdv commented on code in PR #21096:
URL: https://github.com/apache/kafka/pull/21096#discussion_r2630171480


##########
storage/src/main/java/org/apache/kafka/storage/internals/log/ProducerStateEntry.java:
##########
@@ -55,11 +55,11 @@ public ProducerStateEntry(long producerId, short 
producerEpoch, int coordinatorE
         firstBatchMetadata.ifPresent(batchMetadata::add);

Review Comment:
   What are your thoughts on this approach?
   ```
       public ProducerStateEntry(long producerId, short producerEpoch, int 
coordinatorEpoch, long lastTimestamp,
                                 OptionalLong currentTxnFirstOffset, 
Optional<BatchMetadata> firstBatchMetadata) {
           this.producerId = producerId;
           this.producerEpoch = producerEpoch;
           this.coordinatorEpoch = coordinatorEpoch;
           this.currentTxnFirstOffset = currentTxnFirstOffset;
           firstBatchMetadata.ifPresentOrElse(
               batch -> addBatch(producerEpoch, batch.lastSeq(), 
batch.lastOffset(), batch.offsetDelta(), batch.timestamp()),
               () -> this.lastTimestamp = lastTimestamp
           );
       }
   ```



-- 
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]

Reply via email to