AggregationQueryPager.AggregationPartitionIterator (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.service.pager

## Class AggregationQueryPager.AggregationPartitionIterator

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

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

      public final class AggregationQueryPager.AggregationPartitionIterator
      extends AggregationQueryPager.GroupByPartitionIterator

  `PartitionIterator` for queries without Group By but with aggregates.

  For maintaining backward compatibility we are forced to use the `DataLimits.CQLLimits` instead of the `DataLimits.CQLGroupByLimits`. Due to that pages need to be fetched in a different way.

- - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected int` | `computeSubPageSize(int pageSize, int counted)` Computes the size of the next sub-page to retrieve.
    `protected boolean` | `isDone(int pageSize, int counted)`
    `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 org.apache.cassandra.service.pager.AggregationQueryPager.GroupByPartitionIterator

      `close, hasNext, next`

    - ### 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

    - #### AggregationPartitionIterator

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

    - #### AggregationPartitionIterator

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

  - ### Method Detail

    - #### updatePagerLimit

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

      Description copied from class: `AggregationQueryPager.GroupByPartitionIterator`
      Updates the pager with the new limits if needed.
      Overrides:
        `updatePagerLimit` in class `AggregationQueryPager.GroupByPartitionIterator`
      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

    - #### isDone

          protected boolean isDone(int pageSize,
                                   int counted)

      Overrides:
        `isDone` in class `AggregationQueryPager.GroupByPartitionIterator`

    - #### computeSubPageSize

          protected int computeSubPageSize(int pageSize,
                                           int counted)

      Description copied from class: `AggregationQueryPager.GroupByPartitionIterator`
      Computes the size of the next sub-page to retrieve.
      Overrides:
        `computeSubPageSize` in class `AggregationQueryPager.GroupByPartitionIterator`
      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

Copyright © 2018 The Apache Software Foundation