MergeState (Lucene 10.5.1 core API)
Description: declaration: package: org.apache.lucene.index, class: MergeState

Package org.apache.lucene.index

# Class MergeState

java.lang.Object
org.apache.lucene.index.MergeState

public class MergeState extends Object
Holds common state used during segment merging.

WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `MergeState.DocMap`
  A map of doc IDs.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final MergeState.DocMap[]`
  `docMaps`
  Maps document IDs from old segments to document IDs in the new segment
  `final DocValuesProducer[]`
  `docValuesProducers`
  DocValues producers being merged
  `final FieldInfos[]`
  `fieldInfos`
  FieldInfos being merged
  `final FieldsProducer[]`
  `fieldsProducers`
  Postings to merge
  `final InfoStream`
  `infoStream`
  InfoStream for debugging messages.
  `final Executor`
  `intraMergeTaskExecutor`
  Executor for intra merge activity
  `final KnnVectorsReader[]`
  `knnVectorsReaders`
  Vector readers to merge
  `final Bits[]`
  `liveDocs`
  Live docs for each reader
  `final int[]`
  `maxDocs`
  Max docs per reader
  `FieldInfos`
  `mergeFieldInfos`
  `FieldInfos` of the newly merged segment.
  `boolean`
  `needsIndexSort`
  Indicates if the index needs to be sorted *
  `final NormsProducer[]`
  `normsProducers`
  Norms producers being merged
  `final MergePolicy.OneMerge`
  `oneMerge`
  The merge that this state is associated with, or `null` if this merge state is not associated with an `IndexWriter` merge (e.g.
  `final PointsReader[]`
  `pointsReaders`
  Point readers to merge
  `final SegmentInfo`
  `segmentInfo`
  `SegmentInfo` of the newly merged segment.
  `final StoredFieldsReader[]`
  `storedFieldsReaders`
  Stored field producers being merged
  `final TermVectorsReader[]`
  `termVectorsReaders`
  Term vector producers being merged

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MergeState(MergeState.DocMap[] docMaps, SegmentInfo segmentInfo, FieldInfos mergeFieldInfos, StoredFieldsReader[] storedFieldsReaders, TermVectorsReader[] termVectorsReaders, NormsProducer[] normsProducers, DocValuesProducer[] docValuesProducers, FieldInfos[] fieldInfos, Bits[] liveDocs, FieldsProducer[] fieldsProducers, PointsReader[] pointsReaders, KnnVectorsReader[] knnVectorsReaders, int[] maxDocs, InfoStream infoStream, Executor intraMergeTaskExecutor, boolean needsIndexSort, MergePolicy.OneMerge oneMerge)`
  Create a new merge instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `checkAborted()`
  Checks if the merge has been aborted, throwing `MergePolicy.MergeAbortedException` if so.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### docMaps

    public final MergeState.DocMap[] docMaps
    Maps document IDs from old segments to document IDs in the new segment

  - ### segmentInfo

    public final SegmentInfo segmentInfo
    `SegmentInfo` of the newly merged segment.

  - ### mergeFieldInfos

    public FieldInfos mergeFieldInfos
    `FieldInfos` of the newly merged segment.

  - ### storedFieldsReaders

    public final StoredFieldsReader[] storedFieldsReaders
    Stored field producers being merged

  - ### termVectorsReaders

    public final TermVectorsReader[] termVectorsReaders
    Term vector producers being merged

  - ### normsProducers

    public final NormsProducer[] normsProducers
    Norms producers being merged

  - ### docValuesProducers

    public final DocValuesProducer[] docValuesProducers
    DocValues producers being merged

  - ### fieldInfos

    public final FieldInfos[] fieldInfos
    FieldInfos being merged

  - ### liveDocs

    public final Bits[] liveDocs
    Live docs for each reader

  - ### fieldsProducers

    public final FieldsProducer[] fieldsProducers
    Postings to merge

  - ### pointsReaders

    public final PointsReader[] pointsReaders
    Point readers to merge

  - ### knnVectorsReaders

    public final KnnVectorsReader[] knnVectorsReaders
    Vector readers to merge

  - ### maxDocs

    public final int[] maxDocs
    Max docs per reader

  - ### infoStream

    public final InfoStream infoStream
    InfoStream for debugging messages.

  - ### intraMergeTaskExecutor

    public final Executor intraMergeTaskExecutor
    Executor for intra merge activity

  - ### needsIndexSort

    public boolean needsIndexSort
    Indicates if the index needs to be sorted *

  - ### oneMerge

    public final MergePolicy.OneMerge oneMerge
    The merge that this state is associated with, or `null` if this merge state is not associated with an `IndexWriter` merge (e.g. for addIndexes).
    NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

- ## Constructor Details

  - ### MergeState

    public MergeState(MergeState.DocMap[] docMaps, SegmentInfo segmentInfo, FieldInfos mergeFieldInfos, StoredFieldsReader[] storedFieldsReaders, TermVectorsReader[] termVectorsReaders, NormsProducer[] normsProducers, DocValuesProducer[] docValuesProducers, FieldInfos[] fieldInfos, Bits[] liveDocs, FieldsProducer[] fieldsProducers, PointsReader[] pointsReaders, KnnVectorsReader[] knnVectorsReaders, int[] maxDocs, InfoStream infoStream, Executor intraMergeTaskExecutor, boolean needsIndexSort, MergePolicy.OneMerge oneMerge)
    Create a new merge instance.

- ## Method Details

  - ### checkAborted

    public void checkAborted() throws MergePolicy.MergeAbortedException
    Checks if the merge has been aborted, throwing `MergePolicy.MergeAbortedException` if so. This is a no-op if this merge state is not associated with an `IndexWriter` merge.
    Throws:
      `MergePolicy.MergeAbortedException`