Package org.apache.druid.segment.vector
Class NoFilterVectorOffset
- java.lang.Object
-
- org.apache.druid.segment.vector.NoFilterVectorOffset
-
- All Implemented Interfaces:
ReadableVectorInspector
,ReadableVectorOffset
,VectorOffset
,VectorSizeInspector
public class NoFilterVectorOffset extends Object implements VectorOffset
-
-
Field Summary
-
Fields inherited from interface org.apache.druid.segment.vector.ReadableVectorInspector
NULL_ID
-
-
Constructor Summary
Constructors Constructor Description NoFilterVectorOffset(int maxVectorSize, int start, int end)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
advance()
Advances by one batch.int
getCurrentVectorSize()
Returns the current vector size for this cursor.int
getId()
Returns an integer that uniquely identifies the current vector.int
getMaxVectorSize()
Returns the maximum vector size for this cursor.int[]
getOffsets()
If "isContiguous" is false, this method returns a batch of offsets.int
getStartOffset()
If "isContiguous" is true, this method returns the start offset of the range.boolean
isContiguous()
Checks if the current batch is a contiguous range or not.boolean
isDone()
Checks if iteration is "done", meaning the current batch of offsets is empty, and there are no more coming.void
reset()
Resets the object back to its original state.
-
-
-
Method Detail
-
getId
public int getId()
Description copied from interface:ReadableVectorInspector
Returns an integer that uniquely identifies the current vector. This is useful for caching: it is safe to assume nothing has changed in the vector so long as the id remains the same.- Specified by:
getId
in interfaceReadableVectorInspector
-
advance
public void advance()
Description copied from interface:VectorOffset
Advances by one batch.- Specified by:
advance
in interfaceVectorOffset
-
isDone
public boolean isDone()
Description copied from interface:VectorOffset
Checks if iteration is "done", meaning the current batch of offsets is empty, and there are no more coming.- Specified by:
isDone
in interfaceVectorOffset
-
isContiguous
public boolean isContiguous()
Description copied from interface:ReadableVectorOffset
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.- Specified by:
isContiguous
in interfaceReadableVectorOffset
-
getMaxVectorSize
public int getMaxVectorSize()
Description copied from interface:VectorSizeInspector
Returns the maximum vector size for this cursor. It will not change for the lifetime of this cursor, and is generally used to allocate scratch arrays for later processing. Will always be greater than zero.- Specified by:
getMaxVectorSize
in interfaceVectorSizeInspector
-
getCurrentVectorSize
public int getCurrentVectorSize()
Description copied from interface:VectorSizeInspector
Returns the current vector size for this cursor. Will never be larger than the max size returned byVectorSizeInspector.getMaxVectorSize()
.- Specified by:
getCurrentVectorSize
in interfaceVectorSizeInspector
-
getStartOffset
public int getStartOffset()
Description copied from interface:ReadableVectorOffset
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.- Specified by:
getStartOffset
in interfaceReadableVectorOffset
-
getOffsets
public int[] getOffsets()
Description copied from interface:ReadableVectorOffset
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.- Specified by:
getOffsets
in interfaceReadableVectorOffset
-
reset
public void reset()
Description copied from interface:VectorOffset
Resets the object back to its original state. Once this is done, iteration can begin anew.- Specified by:
reset
in interfaceVectorOffset
-
-