Package org.apache.druid.segment.vector
Interface ReadableVectorOffset
- All Superinterfaces:
ReadableVectorInspector,VectorSizeInspector
- All Known Subinterfaces:
VectorOffset
- All Known Implementing Classes:
BitmapVectorOffset,FilteredVectorOffset,NoFilterVectorOffset
Provides a batch of offsets, ostensibly as indexes into an array.
A ReadableVectorOffset should be given to classes (e.g. column selector objects) by something which keeps a
reference to the base VectorOffset object and increments it.
-
Field Summary
Fields inherited from interface org.apache.druid.segment.vector.ReadableVectorInspector
NULL_ID -
Method Summary
Modifier and TypeMethodDescriptiondefault intgetOffset(int index) Gets the offset at a certain index.int[]If "isContiguous" is false, this method returns a batch of offsets.intIf "isContiguous" is true, this method returns the start offset of the range.booleanChecks if the current batch is a contiguous range or not.Methods inherited from interface org.apache.druid.segment.vector.ReadableVectorInspector
getIdMethods inherited from interface org.apache.druid.segment.vector.VectorSizeInspector
getCurrentVectorSize, getMaxVectorSize
-
Method Details
-
isContiguous
boolean isContiguous()Checks if the current batch is a contiguous range or not. This is only good for one batch at a time, since the same object may return some contiguous batches and some non-contiguous batches. So, callers must check this method each time they want to retrieve the current batch of offsets. -
getStartOffset
int getStartOffset()If "isContiguous" is true, this method returns the start offset of the range. The length of the range is given by "getCurrentVectorSize". Throws an exception if "isContiguous" is false. -
getOffsets
int[] getOffsets()If "isContiguous" is false, this method returns a batch of offsets. The array may be longer than the number of valid offsets, so callers need to check "getCurrentVectorSize" too. Throws an exception if "isContiguous" is true. -
getOffset
default int getOffset(int index) Gets the offset at a certain index. To be used in situations where the caller has no optimized path available for contiguous processing.
-