Class 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.