- java.lang.Object
-
- org.apache.lucene.index.DocValuesFieldUpdates
-
- All Implemented Interfaces:
Accountable
- Direct Known Subclasses:
BinaryDocValuesFieldUpdates
,DocValuesFieldUpdates.SingleValueDocValuesFieldUpdates
,NumericDocValuesFieldUpdates
abstract class DocValuesFieldUpdates extends java.lang.Object implements Accountable
Holds updates of a single DocValues field, for a set of documents within one segment.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
DocValuesFieldUpdates.AbstractIterator
(package private) static class
DocValuesFieldUpdates.Iterator
An iterator over documents and their updated values.(package private) static class
DocValuesFieldUpdates.SingleValueDocValuesFieldUpdates
-
Field Summary
Fields Modifier and Type Field Description private int
bitsPerValue
(package private) long
delGen
protected PagedMutable
docs
(package private) java.lang.String
field
private boolean
finished
private static long
HAS_NO_VALUE_MASK
private static long
HAS_VALUE_MASK
protected int
maxDoc
protected static int
PAGE_SIZE
private static int
SHIFT
protected int
size
(package private) DocValuesType
type
-
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DocValuesFieldUpdates(int maxDoc, long delGen, java.lang.String field, DocValuesType type)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) int
add(int doc)
(package private) abstract void
add(int doc, long value)
(package private) abstract void
add(int docId, DocValuesFieldUpdates.Iterator iterator)
Adds the value for the given docID.(package private) abstract void
add(int doc, BytesRef value)
private int
addInternal(int doc, long hasValueMask)
(package private) boolean
any()
Returns true if this instance contains any updates.protected void
ensureFinished()
(package private) void
finish()
Freezes internal data structures and sorts updates by docID for efficient iteration.(package private) boolean
getFinished()
protected void
grow(int size)
(package private) abstract DocValuesFieldUpdates.Iterator
iterator()
Returns anDocValuesFieldUpdates.Iterator
over the updated documents and their values.static DocValuesFieldUpdates.Iterator
mergedIterator(DocValuesFieldUpdates.Iterator[] subs)
Merge-sorts multiple iterators, one per delGen, favoring the largest delGen that has updates for a given docID.long
ramBytesUsed()
Return the memory usage of this object in bytes.(package private) void
reset(int doc)
Adds an update that resets the documents value.protected void
resize(int size)
(package private) int
size()
protected void
swap(int i, int j)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
-
-
-
Field Detail
-
PAGE_SIZE
protected static final int PAGE_SIZE
- See Also:
- Constant Field Values
-
HAS_VALUE_MASK
private static final long HAS_VALUE_MASK
- See Also:
- Constant Field Values
-
HAS_NO_VALUE_MASK
private static final long HAS_NO_VALUE_MASK
- See Also:
- Constant Field Values
-
SHIFT
private static final int SHIFT
- See Also:
- Constant Field Values
-
field
final java.lang.String field
-
type
final DocValuesType type
-
delGen
final long delGen
-
bitsPerValue
private final int bitsPerValue
-
finished
private boolean finished
-
maxDoc
protected final int maxDoc
-
docs
protected PagedMutable docs
-
size
protected int size
-
-
Constructor Detail
-
DocValuesFieldUpdates
protected DocValuesFieldUpdates(int maxDoc, long delGen, java.lang.String field, DocValuesType type)
-
-
Method Detail
-
mergedIterator
public static DocValuesFieldUpdates.Iterator mergedIterator(DocValuesFieldUpdates.Iterator[] subs)
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
abstract void add(int doc, BytesRef value)
-
add
abstract void add(int docId, DocValuesFieldUpdates.Iterator iterator)
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
abstract DocValuesFieldUpdates.Iterator iterator()
Returns anDocValuesFieldUpdates.Iterator
over 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:Accountable
Return the memory usage of this object in bytes. Negative values are illegal.- Specified by:
ramBytesUsed
in interfaceAccountable
-
-