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>
public class ScanQueryLimitRowIterator extends Object implements 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
boolean
hasNext()
ScanResultValue
next()
void
remove()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.java.util.common.parsers.CloseableIterator
flatMap, map
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfaceIterator<ScanResultValue>
-
next
public ScanResultValue next()
- Specified by:
next
in interfaceIterator<ScanResultValue>
-
remove
public void remove()
- Specified by:
remove
in interfaceIterator<ScanResultValue>
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-