Package org.apache.druid.segment.vector
Interface VectorCursor
- All Superinterfaces:
VectorSizeInspector
- All Known Implementing Classes:
FrameVectorCursor
Vectorized cursor used during query execution. VectorCursors are available from
CursorFactory.makeCursorHolder(CursorBuildSpec) via
CursorHolder.asVectorCursor().
See VectorCursorGranularizer for a helper that makes it easier for query
engines to do time granularization.
An example of how to use the methods in this class:
try (CursorHolder cursorHolder = adapter.makeCursorHolder(...)) {
VectorCursor cursor = cursorHolder.asVectorCursor();
// ProcessorClass is some vectorized processor class.
ProcessorClass o = makeProcessor(cursor.getColumnSelectorFactory());
for (; !cursor.isDone(); cursor.advance()) {
o.process();
}
}
-
Method Summary
Modifier and TypeMethodDescriptionvoidadvance()Advances the cursor, skipping forward a number of rows equal to the current vector size.Returns a vectorized column selector factory.booleanisDone()Returns false if the cursor is readable, true if it has nothing left to read.voidreset()Resets the cursor back to its original state.Methods inherited from interface org.apache.druid.segment.vector.VectorSizeInspector
getCurrentVectorSize, getMaxVectorSize
-
Method Details
-
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.
-