apache / lucene

Apache Lucene open-source search software
https://lucene.apache.org/
Apache License 2.0
2.45k stars 973 forks source link

Make `IndexInput#prefetch` take an offset. #13363

Closed jpountz closed 1 month ago

jpountz commented 1 month ago

This makes IndexInput#prefetch take an offset instead of being relative to the current position. This avoids requiring callers to seek only to call prefetch().

rmuir commented 1 month ago

I like this much better from api perspective: it closer maps to madvise() and to me is more straightforward. Especially as the current PRs out there to use it (terms and postings) are using absolute FPs and seeking back-n-forth to workaround the current API.

ChrisHegarty commented 1 month ago

++ this absolute addressing is much nicer. We could even add prefetch to the RandomAccessInput interface, though I'm not sure how much that is used.