rmuir commented on code in PR #13998:
URL: https://github.com/apache/lucene/pull/13998#discussion_r1846706623


##########
lucene/core/src/java21/org/apache/lucene/store/MemorySegmentIndexInput.java:
##########
@@ -406,6 +406,14 @@ void advise(long offset, long length, 
IOConsumer<MemorySegment> advice) throws I
     }
   }
 
+  public Optional<Boolean> isLoaded() {
+    boolean loaded = true;
+    for (MemorySegment seg : segments) {
+      loaded = loaded && seg.isLoaded();
+    }
+    return Optional.of(loaded);
+  }
+

Review Comment:
   we could `return false` as soon as we see it, rather than continue to loop 
and call mincore?



-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to