ocadaruma commented on code in PR #14289:
URL: https://github.com/apache/kafka/pull/14289#discussion_r1493875931


##########
clients/src/main/java/org/apache/kafka/common/record/FileRecords.java:
##########
@@ -421,6 +446,18 @@ private AbstractIterator<FileChannelRecordBatch> 
batchIterator(int start) {
         return new RecordBatchIterator<>(inputStream);
     }
 
+    /**
+     * Try populating OS page cache with file content
+     */
+    public void prepareForRead() throws IOException {
+        if (DEVNULL_PATH != null) {
+            long size = Math.min(channel.size(), end) - start;

Review Comment:
   Good point. `this.size` should work here. Let me fix



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

Reply via email to