public interface VectorCursor extends VectorSizeInspector, Closeable
CursorFactory.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 by
QueryableIndexCursorSequenceBuilder.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. See
VectorCursorGranularizer 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();
}
}
org.apache.druid.segment.Cursor, the non-vectorized version.| Modifier and Type | Method and 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.
|
getCurrentVectorSize, getMaxVectorSizeVectorColumnSelectorFactory getColumnSelectorFactory()
void advance()
boolean isDone()
void reset()
void close()
close in interface AutoCloseableclose in interface CloseableCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.