Class Lucene90DocValuesConsumer
- java.lang.Object
-
- org.apache.lucene.codecs.DocValuesConsumer
-
- org.apache.lucene.codecs.lucene90.Lucene90DocValuesConsumer
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
final class Lucene90DocValuesConsumer extends DocValuesConsumer
writer forLucene90DocValuesFormat
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
Lucene90DocValuesConsumer.MinMaxTracker
-
Field Summary
Fields Modifier and Type Field Description (package private) IndexOutput
data
(package private) int
maxDoc
(package private) IndexOutput
meta
private byte[]
termsDictBuffer
-
Constructor Summary
Constructors Constructor Description Lucene90DocValuesConsumer(SegmentWriteState state, java.lang.String dataCodec, java.lang.String dataExtension, java.lang.String metaCodec, java.lang.String metaExtension)
expert: Creates a new writer
-
Method Summary
All Methods Static 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 fieldprivate void
addTermsDict(SortedSetDocValues values)
void
close()
private int
compressAndGetTermsDictBlockLength(ByteArrayDataOutput bufferedOutput, int dictLength, LZ4.FastCompressionHashTable ht)
private void
doAddSortedField(FieldInfo field, DocValuesProducer valuesProducer)
private void
doAddSortedNumericField(FieldInfo field, DocValuesProducer valuesProducer)
private static boolean
isSingleValued(SortedSetDocValues values)
private ByteArrayDataOutput
maybeGrowBuffer(ByteArrayDataOutput bufferedOutput, int termLength)
private void
writeBlock(long[] values, int length, long gcd, ByteBuffersDataOutput buffer)
private void
writeTermsIndex(SortedSetDocValues values)
private long[]
writeValues(FieldInfo field, DocValuesProducer valuesProducer, boolean ords)
private long
writeValuesMultipleBlocks(SortedNumericDocValues values, long gcd)
private void
writeValuesSingleBlock(SortedNumericDocValues values, long numValues, int numBitsPerValue, long min, long gcd, java.util.Map<java.lang.Long,java.lang.Integer> encode)
-
Methods inherited from class org.apache.lucene.codecs.DocValuesConsumer
isSingleValued, merge, mergeBinaryField, mergeNumericField, mergeSortedField, mergeSortedNumericField, mergeSortedSetField, singletonView
-
-
-
-
Field Detail
-
data
IndexOutput data
-
meta
IndexOutput meta
-
maxDoc
final int maxDoc
-
termsDictBuffer
private byte[] termsDictBuffer
-
-
Constructor Detail
-
Lucene90DocValuesConsumer
public Lucene90DocValuesConsumer(SegmentWriteState state, java.lang.String dataCodec, java.lang.String dataExtension, java.lang.String metaCodec, java.lang.String metaExtension) throws java.io.IOException
expert: Creates a new writer- Throws:
java.io.IOException
-
-
Method Detail
-
close
public void close() throws java.io.IOException
- Throws:
java.io.IOException
-
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.
-
writeValues
private long[] writeValues(FieldInfo field, DocValuesProducer valuesProducer, boolean ords) throws java.io.IOException
- Throws:
java.io.IOException
-
writeValuesSingleBlock
private void writeValuesSingleBlock(SortedNumericDocValues values, long numValues, int numBitsPerValue, long min, long gcd, java.util.Map<java.lang.Long,java.lang.Integer> encode) throws java.io.IOException
- Throws:
java.io.IOException
-
writeValuesMultipleBlocks
private long writeValuesMultipleBlocks(SortedNumericDocValues values, long gcd) throws java.io.IOException
- Throws:
java.io.IOException
-
writeBlock
private void writeBlock(long[] values, int length, long gcd, ByteBuffersDataOutput buffer) throws java.io.IOException
- Throws:
java.io.IOException
-
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.
-
doAddSortedField
private void doAddSortedField(FieldInfo field, DocValuesProducer valuesProducer) throws java.io.IOException
- Throws:
java.io.IOException
-
addTermsDict
private void addTermsDict(SortedSetDocValues values) throws java.io.IOException
- Throws:
java.io.IOException
-
compressAndGetTermsDictBlockLength
private int compressAndGetTermsDictBlockLength(ByteArrayDataOutput bufferedOutput, int dictLength, LZ4.FastCompressionHashTable ht) throws java.io.IOException
- Throws:
java.io.IOException
-
maybeGrowBuffer
private ByteArrayDataOutput maybeGrowBuffer(ByteArrayDataOutput bufferedOutput, int termLength)
-
writeTermsIndex
private void writeTermsIndex(SortedSetDocValues values) throws java.io.IOException
- Throws:
java.io.IOException
-
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.
-
doAddSortedNumericField
private void doAddSortedNumericField(FieldInfo field, DocValuesProducer valuesProducer) throws java.io.IOException
- Throws:
java.io.IOException
-
isSingleValued
private static boolean isSingleValued(SortedSetDocValues values) throws java.io.IOException
- Throws:
java.io.IOException
-
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.
-
-