chishui commented on code in PR #14989: URL: https://github.com/apache/lucene/pull/14989#discussion_r2238326161
########## lucene/core/src/java/org/apache/lucene/index/MergeState.java: ########## @@ -91,7 +91,86 @@ public class MergeState { /** Indicates if the index needs to be sorted * */ public boolean needsIndexSort; - /** Sole constructor. */ + /** Returns the document ID maps. */ + public DocMap[] getDocMaps() { + return docMaps; + } + + /** Returns the segment info of the newly merged segment. */ + public SegmentInfo getSegmentInfo() { + return segmentInfo; + } + + /** Returns the field infos of the newly merged segment. */ + public FieldInfos getMergeFieldInfos() { + return mergeFieldInfos; + } + + /** Returns the stored fields readers being merged. */ + public StoredFieldsReader[] getStoredFieldsReaders() { + return storedFieldsReaders; + } + + /** Returns the term vectors readers being merged. */ + public TermVectorsReader[] getTermVectorsReaders() { + return termVectorsReaders; + } + + /** Returns the norms producers being merged. */ + public NormsProducer[] getNormsProducers() { + return normsProducers; + } + + /** Returns the DocValues producers being merged. */ + public DocValuesProducer[] getDocValuesProducers() { + return docValuesProducers; + } + + /** Returns the field infos being merged. */ + public FieldInfos[] getFieldInfos() { + return fieldInfos; + } + + /** Returns the live docs for each reader. */ + public Bits[] getLiveDocs() { + return liveDocs; + } + + /** Returns the postings to merge. */ + public FieldsProducer[] getFieldsProducers() { + return fieldsProducers; + } + + /** Returns the point readers to merge. */ + public PointsReader[] getPointsReaders() { + return pointsReaders; + } + + /** Returns the vector readers to merge. */ + public KnnVectorsReader[] getKnnVectorsReaders() { + return knnVectorsReaders; + } + + /** Returns the max docs per reader. */ + public int[] getMaxDocs() { + return maxDocs; + } + + /** Returns the info stream for debugging messages. */ + public InfoStream getInfoStream() { + return infoStream; + } + + /** Returns the executor for intra merge activity. */ + public Executor getIntraMergeTaskExecutor() { + return intraMergeTaskExecutor; + } + + /** Returns whether the index needs to be sorted. */ + public boolean getNeedsIndexSort() { + return needsIndexSort; + } Review Comment: Thanks for reviewing. I fully understand that you can just use public fields but that's not the point. Like what I mentioned in the description, it provides better testability, we can easily mock a member function but we can't mock a field access. Apart from that, it's not good practice to have public fields as it doesn't provide good encapsulation. It's just the fields are already public and for backward compatibility, we can't change them to private. -- 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. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org