- java.lang.Object
-
- org.apache.lucene.index.DocValuesWriter<SortedDocValues>
-
- org.apache.lucene.index.SortedDocValuesWriter
-
class SortedDocValuesWriter extends DocValuesWriter<SortedDocValues>
Buffers up pending byte[] per doc, deref and sorting via int ord, then flushes when segment flushes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
SortedDocValuesWriter.BufferedSortedDocValues
(package private) static class
SortedDocValuesWriter.SortingSortedDocValues
-
Field Summary
Fields Modifier and Type Field Description private long
bytesUsed
private DocsWithFieldSet
docsWithField
private FieldInfo
fieldInfo
private int[]
finalOrdMap
private PackedLongValues
finalOrds
private int[]
finalSortedValues
(package private) BytesRefHash
hash
private Counter
iwBytesUsed
private int
lastDocID
private PackedLongValues.Builder
pending
-
Constructor Summary
Constructors Constructor Description SortedDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed, ByteBlockPool pool)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addOneValue(BytesRef value)
void
addValue(int docID, BytesRef value)
private void
finish()
void
flush(SegmentWriteState state, Sorter.DocMap sortMap, DocValuesConsumer dvConsumer)
(package private) SortedDocValues
getDocValues()
(package private) static DocValuesProducer
getDocValuesProducer(FieldInfo writerFieldInfo, BytesRefHash hash, PackedLongValues ords, int[] sortedValues, int[] ordMap, DocsWithFieldSet docsWithField, Sorter.DocMap sortMap)
private static int[]
sortDocValues(int maxDoc, Sorter.DocMap sortMap, SortedDocValues oldValues)
private void
updateBytesUsed()
-
-
-
Field Detail
-
hash
final BytesRefHash hash
-
pending
private final PackedLongValues.Builder pending
-
docsWithField
private final DocsWithFieldSet docsWithField
-
iwBytesUsed
private final Counter iwBytesUsed
-
bytesUsed
private long bytesUsed
-
fieldInfo
private final FieldInfo fieldInfo
-
lastDocID
private int lastDocID
-
finalOrds
private PackedLongValues finalOrds
-
finalSortedValues
private int[] finalSortedValues
-
finalOrdMap
private int[] finalOrdMap
-
-
Constructor Detail
-
SortedDocValuesWriter
public SortedDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed, ByteBlockPool pool)
-
-
Method Detail
-
addValue
public void addValue(int docID, BytesRef value)
-
addOneValue
private void addOneValue(BytesRef value)
-
updateBytesUsed
private void updateBytesUsed()
-
finish
private void finish()
-
getDocValues
SortedDocValues getDocValues()
- Specified by:
getDocValues
in classDocValuesWriter<SortedDocValues>
-
sortDocValues
private static int[] sortDocValues(int maxDoc, Sorter.DocMap sortMap, SortedDocValues oldValues) throws java.io.IOException
- Throws:
java.io.IOException
-
flush
public void flush(SegmentWriteState state, Sorter.DocMap sortMap, DocValuesConsumer dvConsumer) throws java.io.IOException
- Specified by:
flush
in classDocValuesWriter<SortedDocValues>
- Throws:
java.io.IOException
-
getDocValuesProducer
static DocValuesProducer getDocValuesProducer(FieldInfo writerFieldInfo, BytesRefHash hash, PackedLongValues ords, int[] sortedValues, int[] ordMap, DocsWithFieldSet docsWithField, Sorter.DocMap sortMap) throws java.io.IOException
- Throws:
java.io.IOException
-
-