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 (package private) static classBinaryDocValuesWriter.BinaryDVsprivate static classBinaryDocValuesWriter.BufferedBinaryDocValues(package private) static classBinaryDocValuesWriter.SortingBinaryDocValues
-
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 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()
-
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
-
-