(reverse-index) Don't always POST

This commit is contained in:
Viktor Lofgren 2023-10-14 16:48:29 +02:00
parent 6308a8dfcd
commit 9e26109e36

View File

@ -37,13 +37,15 @@ public class ReverseIndexReader {
logger.info("Switching reverse index"); logger.info("Switching reverse index");
this.words = LongArrayFactory.mmapForReadingShared(words); this.words = LongArrayFactory.mmapForReadingShared(words);
this.documents = LongArrayFactory.mmapForReadingShared (documents); this.documents = LongArrayFactory.mmapForReadingShared(documents);
wordsBTreeReader = new BTreeReader(this.words, ReverseIndexParameters.wordsBTreeContext, 0); wordsBTreeReader = new BTreeReader(this.words, ReverseIndexParameters.wordsBTreeContext, 0);
wordsDataOffset = wordsBTreeReader.getHeader().dataOffsetLongs(); wordsDataOffset = wordsBTreeReader.getHeader().dataOffsetLongs();
if (getClass().desiredAssertionStatus()) { if (getClass().desiredAssertionStatus()) {
Executors.newSingleThreadExecutor().execute(this::selfTest); if (Boolean.getBoolean("index-self-test")) {
Executors.newSingleThreadExecutor().execute(this::selfTest);
}
} }
} }