Merge pull request 'Fix madvise code' (#38) from master into release

Reviewed-on: https://git.marginalia.nu/marginalia/marginalia.nu/pulls/38
This commit is contained in:
Viktor Lofgren 2022-07-25 15:21:29 +02:00
commit b571b15c71
3 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ import static java.lang.Math.min;
public class BTreeReader { public class BTreeReader {
private final MultimapFileLong file; private final MultimapFileLong file;
private final BTreeContext ctx; public final BTreeContext ctx;
private final MultimapSearcher indexSearcher; private final MultimapSearcher indexSearcher;
private final MultimapSearcher dataSearcher; private final MultimapSearcher dataSearcher;

View File

@ -95,7 +95,7 @@ public class IndexWordsTable implements AutoCloseable {
offsetConsumer.accept(words.get(posOffset+1)); offsetConsumer.accept(words.get(posOffset+1));
} }
} }
catch (RuntimeException ex) { catch (Exception ex) {
logger.warn("Error @ " + i, ex); logger.warn("Error @ " + i, ex);
break; break;
} }

View File

@ -55,7 +55,7 @@ public class SearchIndex implements AutoCloseable {
if (length > 0) { if (length > 0) {
urls.adviceRange(NativeIO.Advice.WillNeed, h.indexOffsetLongs(), length); urls.adviceRange(NativeIO.Advice.WillNeed, h.indexOffsetLongs(), length);
urls.adviceRange(NativeIO.Advice.Normal, h.dataOffsetLongs(), 2048); urls.adviceRange(NativeIO.Advice.Normal, h.dataOffsetLongs(), Math.min(2048, h.numEntries()*bTreeReader.ctx.entrySize()));
urls.pokeRange(h.indexOffsetLongs(), length); urls.pokeRange(h.indexOffsetLongs(), length);
} }
}); });