Class LongValuesCursor
LongColumn. The cursor produces exactly size()
values for consecutive batch-local doc-ids starting at 0, one per call to nextLong().
Implementations must throw an exception if nextLong() is called more than size() times.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLongValuesCursor(int size) Creates a cursor that will produce exactlysizevalues, one per batch-local doc-id in[0, size). -
Method Summary
Modifier and TypeMethodDescriptionvoidfillDocValues(long[] dst, int offset, int length) Bulk-filllengthvalues intodststarting atoffset, advancing the cursor bylength.voidfillIntPoints(byte[] dst, int offset, int length) Bulk-encodelengthvalues as 4-byte big-endian sortable int points (sign-flipped so negatives sort before positives) intodststarting at byteoffset, advancing the cursor bylength.voidfillLongPoints(byte[] dst, int offset, int length) Bulk-encodelengthvalues as 8-byte big-endian sortable long points (sign-flipped so negatives sort before positives) intodststarting at byteoffset, advancing the cursor bylength.abstract longnextLong()Returns the next long value.final intsize()Total number of values this cursor will produce.
-
Constructor Details
-
LongValuesCursor
protected LongValuesCursor(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
sizeacrossnextLong(),fillDocValues(long[], int, int), and thefillPointsvariants. 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. -
nextLong
public abstract long nextLong()Returns the next long value. Must not be called more thansize()times. -
fillDocValues
public void fillDocValues(long[] dst, int offset, int length) Bulk-filllengthvalues intodststarting atoffset, advancing the cursor bylength. CombinednextLong()andfillcalls must not consume more thansize()values; implementations must throw if they do.The default implementation calls
nextLong()in a loop. Override to provide a more efficient bulk fill (for example aSystem.arraycopy(java.lang.Object, int, java.lang.Object, int, int)from a backing array). -
fillLongPoints
public void fillLongPoints(byte[] dst, int offset, int length) Bulk-encodelengthvalues as 8-byte big-endian sortable long points (sign-flipped so negatives sort before positives) intodststarting at byteoffset, advancing the cursor bylength. Combined consumption acrossnextLong(),fillDocValues(long[], int, int), and thefillPointsvariants must not exceedsize().Values are read in doc-values orientation: callers using this for
DOUBLEcolumns are responsible for ensuring the cursor's longs are alreadysortable-longencoded, which is the documentedLongColumncontract.The default implementation calls
nextLong()per value. Override for a tight indexable loop over a backing array. -
fillIntPoints
public void fillIntPoints(byte[] dst, int offset, int length) Bulk-encodelengthvalues as 4-byte big-endian sortable int points (sign-flipped so negatives sort before positives) intodststarting at byteoffset, advancing the cursor bylength. Each value is narrowed via(int) nextLong(). Combined consumption acrossnextLong(),fillDocValues(long[], int, int), and thefillPointsvariants must not exceedsize().Values are read in doc-values orientation: callers using this for
FLOATcolumns are responsible for ensuring the cursor's longs are alreadysortable-intencoded (in the low 32 bits), which is the documentedLongColumncontract.The default implementation calls
nextLong()per value. Override for a tight indexable loop over a backing array.
-