You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by GitBox <gi...@apache.org> on 2019/03/28 18:54:02 UTC

[GitHub] [lucene-solr] mikemccand commented on a change in pull request #613: LUCENE-8671: Expose FST off/on-heap options on Lucene50PostingsFormat

mikemccand commented on a change in pull request #613: LUCENE-8671: Expose FST off/on-heap options on Lucene50PostingsFormat
URL: https://github.com/apache/lucene-solr/pull/613#discussion_r270152799
 
 

 ##########
 File path: lucene/core/src/java/org/apache/lucene/codecs/blocktree/FieldReader.java
 ##########
 @@ -84,21 +85,18 @@
     // if (DEBUG) {
     //   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
+    isFSTOffHeap = ((this.docCount != this.sumDocFreq) || openedFromWriter == false) && loadFSTOffHeap;
 
 Review comment:
   Should we instead pass in the `FSTLoadMode`  enum down here?  And if it's AUTO then apply these defaulting heuristics?
   
   This way the codec/caller could decide to leave FST off heap even if its a primary key field or its opened from writer?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org