juanka588 commented on a change in pull request #1301: LUCENE-9254: UniformSplit supports FST off-heap. URL: https://github.com/apache/lucene-solr/pull/1301#discussion_r389520479
########## File path: lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/FieldMetadata.java ########## @@ -59,31 +59,38 @@ protected BytesRef lastTerm; /** - * Constructs a {@link FieldMetadata} used for writing the index. This {@link FieldMetadata} is mutable. - * + * Constructs field metadata for writing. * @param maxDoc The total number of documents in the segment being written. */ public FieldMetadata(FieldInfo fieldInfo, int maxDoc) { this(fieldInfo, maxDoc, true); } - public FieldMetadata(FieldInfo fieldInfo, int maxDoc, boolean isMutable) { - this(fieldInfo, maxDoc, isMutable, -1, -1, null); + /** + * Constructs immutable virtual field metadata for reading. + */ + public FieldMetadata(long dictionaryStartFP, long firstBlockStartFP, long lastBlockStartFP, BytesRef lastTerm) { + this(null, 0, false); + this.dictionaryStartFP = dictionaryStartFP; + this.firstBlockStartFP = firstBlockStartFP; + this.lastBlockStartFP = lastBlockStartFP; + this.lastTerm = lastTerm; } /** + * Constructs field metadata for reading or writing. + * @param maxDoc The total number of documents in the segment being written. * @param isMutable Set true if this FieldMetadata is created for writing the index. Set false if it is used for reading the index. */ - public FieldMetadata(FieldInfo fieldInfo, int maxDoc, boolean isMutable, long firstBlockStartFP, long lastBlockStartFP, BytesRef lastTerm) { + protected FieldMetadata(FieldInfo fieldInfo, int maxDoc, boolean isMutable) { assert isMutable || maxDoc == 0; this.fieldInfo = fieldInfo; this.isMutable = isMutable; // docsSeen must not be set if this FieldMetadata is immutable, that means it is used for reading the index. - this.docsSeen = isMutable ? new FixedBitSet(maxDoc) : null; - this.dictionaryStartFP = -1; - this.firstBlockStartFP = firstBlockStartFP; - this.lastBlockStartFP = lastBlockStartFP; - this.lastTerm = lastTerm; + docsSeen = isMutable ? new FixedBitSet(maxDoc) : null; Review comment: remove or add this. for all ---------------------------------------------------------------- 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