juanka588 commented on a change in pull request #1320: LUCENE-9257: Always keep FST off-heap. Remove FSTLoadMode and Reader attributes. URL: https://github.com/apache/lucene-solr/pull/1320#discussion_r388274441
########## File path: lucene/core/src/java/org/apache/lucene/codecs/blocktree/FieldReader.java ########## @@ -82,32 +80,11 @@ // System.out.println("BTTR: seg=" + segment + " field=" + fieldInfo.name + " rootBlockCode=" + rootCode + " divisor=" + indexDivisor); // } rootBlockFP = (new ByteArrayDataInput(rootCode.bytes, rootCode.offset, rootCode.length)).readVLong() >>> BlockTreeTermsReader.OUTPUT_FLAGS_NUM_BITS; - // Initialize FST offheap if index is MMapDirectory and - // docCount != sumDocFreq implying field is not primary key + // Initialize FST always off-heap. if (indexIn != null) { - switch (fstLoadMode) { - case ON_HEAP: - isFSTOffHeap = false; - break; - case OFF_HEAP: - isFSTOffHeap = true; - break; - case OPTIMIZE_UPDATES_OFF_HEAP: - isFSTOffHeap = ((this.docCount != this.sumDocFreq) || openedFromWriter == false); - break; - case AUTO: - isFSTOffHeap = ((this.docCount != this.sumDocFreq) || openedFromWriter == false) && indexIn instanceof ByteBufferIndexInput; - break; - default: - throw new IllegalStateException("unknown enum constant: " + fstLoadMode); - } final IndexInput clone = indexIn.clone(); clone.seek(indexStartFP); - if (isFSTOffHeap) { - index = new FST<>(clone, ByteSequenceOutputs.getSingleton(), new OffHeapFSTStore()); - } else { - index = new FST<>(clone, ByteSequenceOutputs.getSingleton()); - } + index = new FST<>(clone, ByteSequenceOutputs.getSingleton(), new OffHeapFSTStore()); Review comment: nice ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org