shubhamsrkdev commented on code in PR #15627:
URL: https://github.com/apache/lucene/pull/15627#discussion_r2747510918
##########
lucene/core/src/java/org/apache/lucene/store/MemorySegmentIndexInput.java:
##########
@@ -369,14 +370,25 @@ private void updateReadAdvice(ReadAdvice readAdvice)
throws IOException {
long offset = 0;
for (MemorySegment seg : segments) {
- advise(offset, seg.byteSize(), segment -> nativeAccess.madvise(segment,
readAdvice));
+ advise(
+ offset,
+ seg.byteSize(),
+ segment -> {
+ nativeAccess.madvise(segment, readAdvice);
+ return true;
+ });
offset += seg.byteSize();
}
}
- void advise(long offset, long length, IOConsumer<MemorySegment> advice)
throws IOException {
+ @FunctionalInterface
+ interface ReadAdviceConsumer {
Review Comment:
Thanks, much better, done!
##########
lucene/core/src/java/org/apache/lucene/util/IOBooleanSupplier.java:
##########
@@ -34,4 +34,8 @@ public interface IOBooleanSupplier {
* @throws IOException if supplying the result throws an {@link IOException}
*/
boolean get() throws IOException;
+
+ default boolean doDefer() {
Review Comment:
Added!
--
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]