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 classBinaryDocValuesWriter.BufferedBinaryDocValues
-
Field Summary
Fields Modifier and Type Field Description private static intBLOCK_BITSprivate PagedBytesbytesprivate DataOutputbytesOutprivate longbytesUsedprivate DocsWithFieldSetdocsWithFieldprivate FieldInfofieldInfoprivate PackedLongValuesfinalLengthsprivate CounteriwBytesUsedprivate intlastDocIDprivate PackedLongValues.Builderlengthsprivate static intMAX_LENGTHMaximum length for a binary field.private intmaxLength
-
Constructor Summary
Constructors Constructor Description BinaryDocValuesWriter(FieldInfo fieldInfo, Counter iwBytesUsed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValue(int docID, BytesRef value)voidflush(SegmentWriteState state, Sorter.DocMap sortMap, DocValuesConsumer dvConsumer)(package private) BinaryDocValuesgetDocValues()private SortingLeafReader.CachedBinaryDVssortDocValues(int maxDoc, Sorter.DocMap sortMap, BinaryDocValues oldValues)private voidupdateBytesUsed()
-
-
-
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:
getDocValuesin classDocValuesWriter<BinaryDocValues>
-
flush
public void flush(SegmentWriteState state, Sorter.DocMap sortMap, DocValuesConsumer dvConsumer) throws java.io.IOException
- Specified by:
flushin classDocValuesWriter<BinaryDocValues>- Throws:
java.io.IOException
-
-