org.apache.cassandra.service.pager

## Class AggregationQueryPager.GroupByPartitionIterator

- java.lang.Object
- - org.apache.cassandra.service.pager.AggregationQueryPager.GroupByPartitionIterator

All Implemented Interfaces:
  java.lang.AutoCloseable, java.util.Iterator<RowIterator>, BasePartitionIterator<RowIterator>, PartitionIterator, CloseableIterator<RowIterator>

Direct Known Subclasses:
  AggregationQueryPager.AggregationPartitionIterator

Enclosing class:
  AggregationQueryPager

    public class AggregationQueryPager.GroupByPartitionIterator
    extends java.lang.Object
    implements PartitionIterator

`PartitionIterator` that automatically fetch a new sub-page of data if needed when the current iterator is exhausted.

### Constructor Summary

Constructors
Constructor and Description
`GroupByPartitionIterator(int pageSize, ConsistencyLevel consistency, ClientState clientState, long queryStartNanoTime)`
`GroupByPartitionIterator(int pageSize, ReadExecutionController executionController, long queryStartNanoTime)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()`
`protected int` `computeSubPageSize(int pageSize, int counted)` Computes the size of the next sub-page to retrieve.
`boolean` `hasNext()`
`protected boolean` `isDone(int pageSize, int counted)`
`RowIterator` `next()`
`protected QueryPager` `updatePagerLimit(QueryPager pager, DataLimits limits, java.nio.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, wait`

### Methods inherited from interface java.util.Iterator

`forEachRemaining, remove`

### Constructor Detail

#### GroupByPartitionIterator

    public GroupByPartitionIterator(int pageSize,
                                    ConsistencyLevel consistency,
                                    ClientState clientState,
                                    long queryStartNanoTime)

#### GroupByPartitionIterator

    public GroupByPartitionIterator(int pageSize,
                                    ReadExecutionController executionController,
                                    long queryStartNanoTime)

### Method Detail

#### close

    public final void close()

Specified by:
  `close` in interface `java.lang.AutoCloseable`
Specified by:
  `close` in interface `BasePartitionIterator<RowIterator>`
Specified by:
  `close` in interface `CloseableIterator<RowIterator>`

#### hasNext

    public final boolean hasNext()

Specified by:
  `hasNext` in interface `java.util.Iterator<RowIterator>`

#### isDone

    protected boolean isDone(int pageSize,
                             int counted)

#### updatePagerLimit

    protected QueryPager updatePagerLimit(QueryPager pager,
                                          DataLimits limits,
                                          java.nio.ByteBuffer lastPartitionKey,
                                          Clustering lastClustering)

Updates the pager with the new limits if needed.

Parameters:
  `pager` - the pager previoulsy used
  `limits` - the DataLimits
  `lastPartitionKey` - the partition key of the last row returned
  `lastClustering` - 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 size
  `counted` - the number of result returned so far by the previous sub-pages
Returns:
  the size of the next sub-page to retrieve

#### next

    public final RowIterator next()

Specified by:
  `next` in interface `java.util.Iterator<RowIterator>`