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/02/09 14:57:43 UTC

[GitHub] msokolov commented on a change in pull request #563: Support for moving FST offheap except PK

msokolov commented on a change in pull request #563: Support for moving FST offheap except PK
URL: https://github.com/apache/lucene-solr/pull/563#discussion_r255301101
 
 

 ##########
 File path: lucene/core/src/java/org/apache/lucene/codecs/blocktree/FieldReader.java
 ##########
 @@ -86,9 +88,14 @@
 
     if (indexIn != null) {
       final IndexInput clone = indexIn.clone();
-      //System.out.println("start=" + indexStartFP + " field=" + fieldInfo.name);
       clone.seek(indexStartFP);
-      index = new FST<>(clone, ByteSequenceOutputs.getSingleton());
+      // Initialize FST offheap if index is MMapDirectory and
+      // docCount != sumDocFreq implying field is not primary key
+      if (clone instanceof ByteBufferIndexInput && this.docCount != this.sumDocFreq) {
+        index = new FST<>(clone, ByteSequenceOutputs.getSingleton(), new OffHeapFSTStore());
+      } else {
+        index = new FST<>(clone, ByteSequenceOutputs.getSingleton());
 
 Review comment:
   Maybe add a print statement here and run the benchmarks to see whether the primary key field is being detected correctly?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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