s1monw commented on a change in pull request #640: LUCENE-8671: Introduce
Reader attributes
URL: https://github.com/apache/lucene-solr/pull/640#discussion_r274786488
##########
File path:
lucene/core/src/java/org/apache/lucene/codecs/blocktree/BlockTreeTermsReader.java
##########
@@ -75,6 +74,41 @@
public final class BlockTreeTermsReader extends FieldsProducer {
+ /**
+ * An enum that allows to control if term index FSTs are loaded into memory
or read off-heap
+ */
+ public enum FSTLoadMode {
+ /**
+ * Always read FSTs from disk.
+ * NOTE: If this option is used the FST will be read off-heap even if
buffered directory implementations
+ * are used.
+ */
+ OFF_HEAP,
+ /**
+ * Never read FSTs from disk ie. all fields FSTs are loaded into memory
+ */
+ ON_HEAP,
+ /**
+ * Always read FSTs from disk.
+ * An exception is made for ID fields in an IndexWriter context which are
always loaded into memory.
+ * This is useful to guarantee best update performance even if a non
MMapDirectory is used.
+ * NOTE: If this option is used the FST will be read off-heap even if
buffered directory implementations
+ * are used.
+ * See {@link FSTLoadMode#AUTO}
+ */
+ OPTIMIZE_UPDATES_OFF_HEAP,
+ /**
+ * Automatically make the decision if FSTs are read from disk depending if
the segment read from an MMAPDirectory
+ * An exception is made for ID fields in an IndexWriter context which are
always loaded into memory.
+ */
+ AUTO
+ }
+
+ /** Attribute key for fst mode. */
+ public static final String FST_MODE_KEY = "blocktree.terms.fst.mode";
+ /** Attribute key for the ID field. ID fields are forced on-heap if set **/
+ public static final String ID_FIELD = "blocktree.terms.fst.id_field"; //
TODO should this only happen in a writer context?
Review comment:
yeah I had this before, I can go back to this for sure.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]