Package org.apache.lucene.index
Class SortedDocValuesWriter
- 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 private static classSortedDocValuesWriter.BufferedSortedDocValues(package private) static classSortedDocValuesWriter.SortingSortedDocValues
-
Field Summary
Fields Modifier and Type Field Description private longbytesUsedprivate DocsWithFieldSetdocsWithFieldprivate FieldInfofieldInfoprivate int[]finalOrdMapprivate PackedLongValuesfinalOrdsprivate int[]finalSortedValues(package private) BytesRefHashhashprivate CounteriwBytesUsedprivate intlastDocIDprivate PackedLongValues.Builderpending
-
Constructor Summary
Constructors Constructor Description SortedDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddOneValue(BytesRef value)voidaddValue(int docID, BytesRef value)voidflush(SegmentWriteState state, Sorter.DocMap sortMap, DocValuesConsumer dvConsumer)(package private) SortedDocValuesgetDocValues()private int[]sortDocValues(int maxDoc, Sorter.DocMap sortMap, SortedDocValues oldValues)private voidupdateBytesUsed()
-
-
-
Field Detail
-
hash
final BytesRefHash hash
-
pending
private PackedLongValues.Builder pending
-
docsWithField
private 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
-
-
Method Detail
-
addValue
public void addValue(int docID, BytesRef value)
-
addOneValue
private void addOneValue(BytesRef value)
-
updateBytesUsed
private void updateBytesUsed()
-
getDocValues
SortedDocValues getDocValues()
- Specified by:
getDocValuesin classDocValuesWriter<SortedDocValues>
-
sortDocValues
private 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:
flushin classDocValuesWriter<SortedDocValues>- Throws:
java.io.IOException
-
-