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


##########
storage/src/main/java/org/apache/kafka/storage/internals/log/ProducerStateEntry.java:
##########
@@ -71,36 +71,32 @@ public long lastDataOffset() {
         return isEmpty() ? -1L : batchMetadata.getLast().lastOffset();
     }
 
-    public int lastOffsetDelta() {
+    int lastOffsetDelta() {
         return isEmpty() ? 0 : batchMetadata.getLast().offsetDelta();
     }
 
-    public boolean isEmpty() {
+    boolean isEmpty() {
         return batchMetadata.isEmpty();
     }
 
     /**
      * Returns a new instance with the provided parameters (when present) and 
the values from the current instance
      * otherwise.
      */
-    public ProducerStateEntry withProducerIdAndBatchMetadata(long producerId, 
Optional<BatchMetadata> batchMetadata) {
-        return new ProducerStateEntry(producerId, this.producerEpoch(), 
this.coordinatorEpoch, this.lastTimestamp,
-            this.currentTxnFirstOffset, batchMetadata);
+    ProducerStateEntry withProducerIdAndBatchMetadata(long producerId, 
Optional<BatchMetadata> batchMetadata) {

Review Comment:
   it appears `batchMetadata` is not used in production. could you refactor it 
as well?



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