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 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)`
Create a new merge instance.

## Method Summary

### 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 *

## 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)
Create a new merge instance.