Package org.apache.druid.segment.vector
Interface VectorCursor
-
- All Superinterfaces:
AutoCloseable
,Closeable
,VectorSizeInspector
- All Known Implementing Classes:
FrameVectorCursor
public interface VectorCursor extends VectorSizeInspector, Closeable
Vectorized cursor used during query execution. VectorCursors are returned byCursorFactory.makeVectorCursor(org.apache.druid.query.filter.Filter, org.joda.time.Interval, org.apache.druid.segment.VirtualColumns, boolean, int, org.apache.druid.query.QueryMetrics<?>)
and are created byQueryableIndexCursorSequenceBuilder.buildVectorized(int)
. Unlike the non-vectorized version, VectorCursor does not have a getTime() method. This is because we are trying to avoid creating needlessly-small vectors when the time granularity is very fine. SeeVectorCursorGranularizer
for a helper that makes it easier for query engines to do their own time granularization. An example of how to use the methods in this class:try (VectorCursor cursor = adapter.makeVectorCursor(...)) { // ProcessorClass is some vectorized processor class. ProcessorClass o = makeProcessor(cursor.getColumnSelectorFactory()); for (; !cursor.isDone(); cursor.advance()) { o.process(); } }
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
advance()
Advances the cursor, skipping forward a number of rows equal to the current vector size.void
close()
Close the cursor and release its resources.VectorColumnSelectorFactory
getColumnSelectorFactory()
Returns a vectorized column selector factory.boolean
isDone()
Returns false if the cursor is readable, true if it has nothing left to read.void
reset()
Resets the cursor back to its original state.-
Methods inherited from interface org.apache.druid.segment.vector.VectorSizeInspector
getCurrentVectorSize, getMaxVectorSize
-
-
-
-
Method Detail
-
getColumnSelectorFactory
VectorColumnSelectorFactory getColumnSelectorFactory()
Returns a vectorized column selector factory.
-
advance
void advance()
Advances the cursor, skipping forward a number of rows equal to the current vector size.
-
isDone
boolean isDone()
Returns false if the cursor is readable, true if it has nothing left to read.
-
reset
void reset()
Resets the cursor back to its original state. Useful for query engines that want to make multiple passes.
-
close
void close()
Close the cursor and release its resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-