java.lang.Object
org.apache.lucene.index.DocValuesFieldUpdates
- All Implemented Interfaces:
Accountable
- Direct Known Subclasses:
BinaryDocValuesFieldUpdates,DocValuesFieldUpdates.SingleValueDocValuesFieldUpdates,NumericDocValuesFieldUpdates
Holds updates of a single DocValues field, for a set of documents within one segment.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class(package private) static classAn iterator over documents and their updated values.(package private) static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int(package private) final longprotected PagedMutable(package private) final Stringprivate booleanprivate static final longprivate static final longprotected final intprotected static final intprivate static final intprotected int(package private) final DocValuesTypeFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDocValuesFieldUpdates(int maxDoc, long delGen, String field, DocValuesType type) -
Method Summary
Modifier and TypeMethodDescription(package private) final intadd(int doc) (package private) abstract voidadd(int doc, long value) (package private) abstract voidadd(int docId, DocValuesFieldUpdates.Iterator iterator) Adds the value for the given docID.(package private) abstract voidprivate intaddInternal(int doc, long hasValueMask) (package private) booleanany()Returns true if this instance contains any updates.protected final void(package private) final voidfinish()Freezes internal data structures and sorts updates by docID for efficient iteration.(package private) final booleanprotected voidgrow(int size) (package private) abstract DocValuesFieldUpdates.Iteratoriterator()Returns anDocValuesFieldUpdates.Iteratorover the updated documents and their values.Merge-sorts multiple iterators, one per delGen, favoring the largest delGen that has updates for a given docID.longReturn the memory usage of this object in bytes.(package private) voidreset(int doc) Adds an update that resets the documents value.protected voidresize(int size) (package private) final intsize()protected voidswap(int i, int j) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Field Details
-
PAGE_SIZE
protected static final int PAGE_SIZE- See Also:
-
HAS_VALUE_MASK
private static final long HAS_VALUE_MASK- See Also:
-
HAS_NO_VALUE_MASK
private static final long HAS_NO_VALUE_MASK- See Also:
-
SHIFT
private static final int SHIFT- See Also:
-
field
-
type
-
delGen
final long delGen -
bitsPerValue
private final int bitsPerValue -
finished
private boolean finished -
maxDoc
protected final int maxDoc -
docs
-
size
protected int size
-
-
Constructor Details
-
DocValuesFieldUpdates
-
-
Method Details
-
mergedIterator
Merge-sorts multiple iterators, one per delGen, favoring the largest delGen that has updates for a given docID. -
getFinished
final boolean getFinished() -
add
abstract void add(int doc, long value) -
add
-
add
Adds the value for the given docID. This method prevents conditional calls toDocValuesFieldUpdates.Iterator.longValue()orDocValuesFieldUpdates.Iterator.binaryValue()since the implementation knows if it's a long value iterator or binary value -
iterator
Returns anDocValuesFieldUpdates.Iteratorover the updated documents and their values. -
finish
final void finish()Freezes internal data structures and sorts updates by docID for efficient iteration. -
any
boolean any()Returns true if this instance contains any updates. -
size
final int size() -
reset
void reset(int doc) Adds an update that resets the documents value.- Parameters:
doc- the doc to update
-
add
final int add(int doc) -
addInternal
private int addInternal(int doc, long hasValueMask) -
swap
protected void swap(int i, int j) -
grow
protected void grow(int size) -
resize
protected void resize(int size) -
ensureFinished
protected final void ensureFinished() -
ramBytesUsed
public long ramBytesUsed()Description copied from interface:AccountableReturn the memory usage of this object in bytes. Negative values are illegal.- Specified by:
ramBytesUsedin interfaceAccountable
-