Class PerFieldDocValuesFormat.FieldsWriter
- java.lang.Object
-
- org.apache.lucene.codecs.DocValuesConsumer
-
- org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat.FieldsWriter
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Enclosing class:
- PerFieldDocValuesFormat
private class PerFieldDocValuesFormat.FieldsWriter extends DocValuesConsumer
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<DocValuesFormat,PerFieldDocValuesFormat.ConsumerAndSuffix>formatsprivate SegmentWriteStatesegmentWriteStateprivate java.util.Map<java.lang.String,java.lang.Integer>suffixes
-
Constructor Summary
Constructors Constructor Description FieldsWriter(SegmentWriteState state)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBinaryField(FieldInfo field, DocValuesProducer valuesProducer)Writes binary docvalues for a field.voidaddNumericField(FieldInfo field, DocValuesProducer valuesProducer)Writes numeric docvalues for a field.voidaddSortedField(FieldInfo field, DocValuesProducer valuesProducer)Writes pre-sorted binary docvalues for a field.voidaddSortedNumericField(FieldInfo field, DocValuesProducer valuesProducer)Writes pre-sorted numeric docvalues for a fieldvoidaddSortedSetField(FieldInfo field, DocValuesProducer valuesProducer)Writes pre-sorted set docvalues for a fieldvoidclose()private DocValuesConsumergetInstance(FieldInfo field)private DocValuesConsumergetInstance(FieldInfo field, boolean ignoreCurrentFormat)DocValuesConsumer for the given field.voidmerge(MergeState mergeState)Merges in the fields from the readers inmergeState.-
Methods inherited from class org.apache.lucene.codecs.DocValuesConsumer
isSingleValued, mergeBinaryField, mergeNumericField, mergeSortedField, mergeSortedNumericField, mergeSortedSetField, singletonView
-
-
-
-
Field Detail
-
formats
private final java.util.Map<DocValuesFormat,PerFieldDocValuesFormat.ConsumerAndSuffix> formats
-
suffixes
private final java.util.Map<java.lang.String,java.lang.Integer> suffixes
-
segmentWriteState
private final SegmentWriteState segmentWriteState
-
-
Constructor Detail
-
FieldsWriter
public FieldsWriter(SegmentWriteState state)
-
-
Method Detail
-
addNumericField
public void addNumericField(FieldInfo field, DocValuesProducer valuesProducer) throws java.io.IOException
Description copied from class:DocValuesConsumerWrites numeric docvalues for a field.- Specified by:
addNumericFieldin classDocValuesConsumer- Parameters:
field- field informationvaluesProducer- Numeric values to write.- Throws:
java.io.IOException- if an I/O error occurred.
-
addBinaryField
public void addBinaryField(FieldInfo field, DocValuesProducer valuesProducer) throws java.io.IOException
Description copied from class:DocValuesConsumerWrites binary docvalues for a field.- Specified by:
addBinaryFieldin classDocValuesConsumer- Parameters:
field- field informationvaluesProducer- Binary values to write.- Throws:
java.io.IOException- if an I/O error occurred.
-
addSortedField
public void addSortedField(FieldInfo field, DocValuesProducer valuesProducer) throws java.io.IOException
Description copied from class:DocValuesConsumerWrites pre-sorted binary docvalues for a field.- Specified by:
addSortedFieldin classDocValuesConsumer- Parameters:
field- field informationvaluesProducer- produces the values and ordinals to write- Throws:
java.io.IOException- if an I/O error occurred.
-
addSortedNumericField
public void addSortedNumericField(FieldInfo field, DocValuesProducer valuesProducer) throws java.io.IOException
Description copied from class:DocValuesConsumerWrites pre-sorted numeric docvalues for a field- Specified by:
addSortedNumericFieldin classDocValuesConsumer- Parameters:
field- field informationvaluesProducer- produces the values to write- Throws:
java.io.IOException- if an I/O error occurred.
-
addSortedSetField
public void addSortedSetField(FieldInfo field, DocValuesProducer valuesProducer) throws java.io.IOException
Description copied from class:DocValuesConsumerWrites pre-sorted set docvalues for a field- Specified by:
addSortedSetFieldin classDocValuesConsumer- Parameters:
field- field informationvaluesProducer- produces the values to write- Throws:
java.io.IOException- if an I/O error occurred.
-
merge
public void merge(MergeState mergeState) throws java.io.IOException
Description copied from class:DocValuesConsumerMerges in the fields from the readers inmergeState. The default implementation callsDocValuesConsumer.mergeNumericField(org.apache.lucene.index.FieldInfo, org.apache.lucene.index.MergeState),DocValuesConsumer.mergeBinaryField(org.apache.lucene.index.FieldInfo, org.apache.lucene.index.MergeState),DocValuesConsumer.mergeSortedField(org.apache.lucene.index.FieldInfo, org.apache.lucene.index.MergeState),DocValuesConsumer.mergeSortedSetField(org.apache.lucene.index.FieldInfo, org.apache.lucene.index.MergeState), orDocValuesConsumer.mergeSortedNumericField(org.apache.lucene.index.FieldInfo, org.apache.lucene.index.MergeState)for each field, depending on its type. Implementations can override this method for more sophisticated merging (bulk-byte copying, etc).- Overrides:
mergein classDocValuesConsumer- Throws:
java.io.IOException
-
getInstance
private DocValuesConsumer getInstance(FieldInfo field) throws java.io.IOException
- Throws:
java.io.IOException
-
getInstance
private DocValuesConsumer getInstance(FieldInfo field, boolean ignoreCurrentFormat) throws java.io.IOException
DocValuesConsumer for the given field.- Parameters:
field- - FieldInfo object.ignoreCurrentFormat- - ignore the existing format attributes.- Returns:
- DocValuesConsumer for the field.
- Throws:
java.io.IOException- if there is a low-level IO error
-
close
public void close() throws java.io.IOException- Throws:
java.io.IOException
-
-