Class BytesRefValuesCursor
java.lang.Object
org.apache.lucene.document.column.BytesRefValuesCursor
A values cursor over a dense
BinaryColumn. The cursor produces exactly size()
values for consecutive batch-local doc-ids starting at 0, one per call to nextValue().
Implementations must throw an exception if nextValue() is called more than size() times. The returned BytesRef is valid only until the next call to nextValue().
Combined consumption across nextValue() and fillPackedPoints(byte[], int, int, int) must not exceed
size().
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBytesRefValuesCursor(int size) Creates a cursor that will produce exactlysizevalues, one per batch-local doc-id in[0, size). -
Method Summary
Modifier and TypeMethodDescriptionvoidfillPackedPoints(byte[] dst, int offset, int length, int width) Bulk-filllengthfixed-width packed point records intodststarting at byteoffset, advancing the cursor bylength.abstract BytesRefReturns the nextBytesRefvalue.final intsize()Total number of values this cursor will produce.
-
Constructor Details
-
BytesRefValuesCursor
protected BytesRefValuesCursor(int size) Creates a cursor that will produce exactlysizevalues, one per batch-local doc-id in[0, size).sizeis fixed for the cursor's lifetime and must equal the dense column'snumDocs.Lucene's internal indexing paths will not consume past
sizeacrossnextValue()andfillPackedPoints(byte[], int, int, int). Defensive throws on overrun are still encouraged to catch misuse from external callers.
-
-
Method Details
-
size
public final int size()Total number of values this cursor will produce. -
nextValue
-
fillPackedPoints
public void fillPackedPoints(byte[] dst, int offset, int length, int width) Bulk-filllengthfixed-width packed point records intodststarting at byteoffset, advancing the cursor bylength. Each value must be exactlywidthbytes and is passed through unchanged (no sortable encoding). Combined consumption acrossnextValue()and this method must not exceedsize().The default implementation calls
nextValue()per value and validates each length. Override when the backing data is optimizable (e.g. a contiguous packed array); such overrides take responsibility for the width contract.
-