Module org.apache.lucene.core
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>
formats
private SegmentWriteState
segmentWriteState
private 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 void
addBinaryField(FieldInfo field, DocValuesProducer valuesProducer)
Writes binary docvalues for a field.void
addNumericField(FieldInfo field, DocValuesProducer valuesProducer)
Writes numeric docvalues for a field.void
addSortedField(FieldInfo field, DocValuesProducer valuesProducer)
Writes pre-sorted binary docvalues for a field.void
addSortedNumericField(FieldInfo field, DocValuesProducer valuesProducer)
Writes pre-sorted numeric docvalues for a fieldvoid
addSortedSetField(FieldInfo field, DocValuesProducer valuesProducer)
Writes pre-sorted set docvalues for a fieldvoid
close()
private DocValuesConsumer
getInstance(FieldInfo field)
private DocValuesConsumer
getInstance(FieldInfo field, boolean ignoreCurrentFormat)
DocValuesConsumer for the given field.void
merge(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:DocValuesConsumer
Writes numeric docvalues for a field.- Specified by:
addNumericField
in 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:DocValuesConsumer
Writes binary docvalues for a field.- Specified by:
addBinaryField
in 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:DocValuesConsumer
Writes pre-sorted binary docvalues for a field.- Specified by:
addSortedField
in 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:DocValuesConsumer
Writes pre-sorted numeric docvalues for a field- Specified by:
addSortedNumericField
in 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:DocValuesConsumer
Writes pre-sorted set docvalues for a field- Specified by:
addSortedSetField
in 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:DocValuesConsumer
Merges 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:
merge
in 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
-
-