Package org.apache.druid.query.scan
Class ScanQueryLimitRowIterator
java.lang.Object
org.apache.druid.query.scan.ScanQueryLimitRowIterator
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterator<ScanResultValue>,CloseableIterator<ScanResultValue>
This iterator supports iteration through a Sequence returned by a ScanResultValue QueryRunner. Its behaviour
varies depending on whether the query is returning time-ordered values and whether the CTX_KEY_OUTERMOST flag is
set as false.
Behaviours:
1) No time ordering: expects a Sequence of ScanResultValues which each contain up to query.batchSize events.
The iterator will be "done" when the limit of events is reached. The final ScanResultValue might contain
fewer than batchSize events so that the limit number of events is returned.
2) Time Ordering, CTX_KEY_OUTERMOST false: Same behaviour as no time ordering
3) Time Ordering, CTX_KEY_OUTERMOST=true or null: The Sequence processed in this case should contain ScanResultValues
that contain only one event each for the CachingClusteredClient n-way merge. This iterator will perform
batching according to query batch size until the limit is reached.
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.druid.java.util.common.parsers.CloseableIterator
flatMap, mapMethods inherited from interface java.util.Iterator
forEachRemaining
-
Method Details
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceIterator<ScanResultValue>
-
next
- Specified by:
nextin interfaceIterator<ScanResultValue>
-
remove
public void remove()- Specified by:
removein interfaceIterator<ScanResultValue>
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-