Class AggregationQueryPager.GroupByPartitionIterator
java.lang.Object
org.apache.cassandra.service.pager.AggregationQueryPager.GroupByPartitionIterator
- All Implemented Interfaces:
AutoCloseable,Iterator<RowIterator>,BasePartitionIterator<RowIterator>,PartitionIterator,CloseableIterator<RowIterator>
- Direct Known Subclasses:
AggregationQueryPager.AggregationPartitionIterator
- Enclosing class:
- AggregationQueryPager
public class AggregationQueryPager.GroupByPartitionIterator
extends Object
implements PartitionIterator
PartitionIterator that automatically fetch a new sub-page of data if needed when the current iterator is
exhausted.-
Constructor Summary
ConstructorsConstructorDescriptionGroupByPartitionIterator(int pageSize, ConsistencyLevel consistency, ClientState clientState, Dispatcher.RequestTime requestTime) GroupByPartitionIterator(int pageSize, ReadExecutionController executionController, Dispatcher.RequestTime requestTime) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclose()protected intcomputeSubPageSize(int pageSize, int counted) Computes the size of the next sub-page to retrieve.final booleanhasNext()protected booleanisDone(int pageSize, int counted) final RowIteratornext()protected QueryPagerupdatePagerLimit(QueryPager pager, DataLimits limits, ByteBuffer lastPartitionKey, Clustering<?> lastClustering) Updates the pager with the new limits if needed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
GroupByPartitionIterator
public GroupByPartitionIterator(int pageSize, ConsistencyLevel consistency, ClientState clientState, Dispatcher.RequestTime requestTime) -
GroupByPartitionIterator
public GroupByPartitionIterator(int pageSize, ReadExecutionController executionController, Dispatcher.RequestTime requestTime)
-
-
Method Details
-
close
public final void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceBasePartitionIterator<RowIterator>- Specified by:
closein interfaceCloseableIterator<RowIterator>
-
hasNext
public final boolean hasNext()- Specified by:
hasNextin interfaceIterator<RowIterator>
-
isDone
protected boolean isDone(int pageSize, int counted) -
updatePagerLimit
protected QueryPager updatePagerLimit(QueryPager pager, DataLimits limits, ByteBuffer lastPartitionKey, Clustering<?> lastClustering) Updates the pager with the new limits if needed.- Parameters:
pager- the pager previoulsy usedlimits- the DataLimitslastPartitionKey- the partition key of the last row returnedlastClustering- the clustering of the last row returned- Returns:
- the pager to use to query the next page of data
-
computeSubPageSize
protected int computeSubPageSize(int pageSize, int counted) Computes the size of the next sub-page to retrieve.- Parameters:
pageSize- the top-level page sizecounted- the number of result returned so far by the previous sub-pages- Returns:
- the size of the next sub-page to retrieve
-
next
- Specified by:
nextin interfaceIterator<RowIterator>
-