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


##########
jmh-benchmarks/src/main/java/org/apache/kafka/jmh/log/TestLinearWriteSpeed.java:
##########
@@ -323,6 +266,7 @@ public LogWritable(File dir, LogConfig config, Scheduler 
scheduler, MemoryRecord
         }
 
         public int write() {
+            this.messages = MemoryRecords.withRecords(compression, records);

Review Comment:
   Instead of creating new `messages`, it might be better to reset the base 
offset. For example:
   ```java
   messages.batches().forEach(b -> b.setLastOffset(0));
   ```



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