OneMerge
OneMerge provides the information necessary to perform an individual primitive merge operation, resulting in a single new segment. The merge spec includes the subset of segments to be merged as well as whether the new segment should use the compound file format.
Properties
Estimated size in bytes of the merged segment.
Control used to pause/stop/resume the merge thread.
Returns the merge readers or an empty list if the readers were not initialized yet.
Segments to be merged.
Total number of documents in segments to be merged, not accounting for deletions.
Functions
Checks if merge has been aborted and throws a merge exception if so.
Closes this merge and releases all merge readers
Returns true if the merge completed successfully or false if the merge succeeded with a failure. This method will not block and return an empty Optional if the merge has not finished yet
Returns true if the merge has finished or false if it's still running or has not been started. This method will not block.
Sets the merge readers for this merge.
Called by IndexWriter after the merge is done and all readers have been closed.
Called by IndexWriter after the merge started and from the thread that will be executing the merge.
Called just before the merge is applied to IndexWriter's SegmentInfos
Extend this method if you wish to renumber doc IDs. This method will be called when index sorting is disabled on a merged view of the OneMerge. A null return value indicates that doc IDs should not be reordered.
Marks this merge as aborted. The merge thread should terminate at the soonest possible moment.
Expert: Sets the SegmentCommitInfo of the merged segment. Allows sub-classes to e.g. add diagnostic properties.
Returns the total size in bytes of this merge. Note that this does not indicate the size of the merged segment, but the input total size. This is only set once the merge is initialized by IndexWriter.
Returns the total number of documents that are included with this merge. Note that this does not indicate the number of documents after the merge.
Wrap a reader prior to merging in order to add/remove fields or documents.