Package org.apache.lucene.index
Class BinaryDocValuesWriter
- java.lang.Object
-
- org.apache.lucene.index.DocValuesWriter<BinaryDocValues>
-
- org.apache.lucene.index.BinaryDocValuesWriter
-
class BinaryDocValuesWriter extends DocValuesWriter<BinaryDocValues>
Buffers up pending byte[] per doc, then flushes when segment flushes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
BinaryDocValuesWriter.BufferedBinaryDocValues
-
Field Summary
Fields Modifier and Type Field Description private static int
BLOCK_BITS
private PagedBytes
bytes
private DataOutput
bytesOut
private long
bytesUsed
private DocsWithFieldSet
docsWithField
private FieldInfo
fieldInfo
private PackedLongValues
finalLengths
private Counter
iwBytesUsed
private int
lastDocID
private PackedLongValues.Builder
lengths
private static int
MAX_LENGTH
Maximum length for a binary field.private int
maxLength
-
Constructor Summary
Constructors Constructor Description BinaryDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addValue(int docID, BytesRef value)
void
flush(SegmentWriteState state, Sorter.DocMap sortMap, DocValuesConsumer dvConsumer)
(package private) BinaryDocValues
getDocValues()
private SortingLeafReader.CachedBinaryDVs
sortDocValues(int maxDoc, Sorter.DocMap sortMap, BinaryDocValues oldValues)
private void
updateBytesUsed()
-
-
-
Field Detail
-
MAX_LENGTH
private static final int MAX_LENGTH
Maximum length for a binary field.
-
BLOCK_BITS
private static final int BLOCK_BITS
- See Also:
- Constant Field Values
-
bytes
private final PagedBytes bytes
-
bytesOut
private final DataOutput bytesOut
-
iwBytesUsed
private final Counter iwBytesUsed
-
lengths
private final PackedLongValues.Builder lengths
-
docsWithField
private DocsWithFieldSet docsWithField
-
fieldInfo
private final FieldInfo fieldInfo
-
bytesUsed
private long bytesUsed
-
lastDocID
private int lastDocID
-
maxLength
private int maxLength
-
finalLengths
private PackedLongValues finalLengths
-
-
Method Detail
-
addValue
public void addValue(int docID, BytesRef value)
-
updateBytesUsed
private void updateBytesUsed()
-
sortDocValues
private SortingLeafReader.CachedBinaryDVs sortDocValues(int maxDoc, Sorter.DocMap sortMap, BinaryDocValues oldValues) throws java.io.IOException
- Throws:
java.io.IOException
-
getDocValues
BinaryDocValues getDocValues()
- Specified by:
getDocValues
in classDocValuesWriter<BinaryDocValues>
-
flush
public void flush(SegmentWriteState state, Sorter.DocMap sortMap, DocValuesConsumer dvConsumer) throws java.io.IOException
- Specified by:
flush
in classDocValuesWriter<BinaryDocValues>
- Throws:
java.io.IOException
-
-