michaeljmarshall commented on code in PR #16145:
URL: https://github.com/apache/lucene/pull/16145#discussion_r3336997605
##########
lucene/core/src/java/org/apache/lucene/store/MemorySegmentIndexInput.java:
##########
@@ -349,8 +359,12 @@ public boolean prefetch(long offset, long length) throws
IOException {
length,
segment -> {
if (segment.isLoaded() == false) {
Review Comment:
I think it makes sense to remove this check when we have advised `RANDOM`,
but note that we do use the `isLoaded()` information to determine whether to
call `madvise` and whether to return true or false where true indicates the
caller should defer access to the prefetched page. From the method's javadoc:
```java
* @return true if prefetch actually prefetched something, hence user can
benefit from deferring
* reading the prefetched memory block.
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]