uschindler commented on code in PR #15627:
URL: https://github.com/apache/lucene/pull/15627#discussion_r2742607469
##########
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:
You could use `IOFunction<MemorySegment,Boolean>`. There's no overhead by
the returned instance as there are only 2 boolean instances.
--
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]