RangeNamesQueryPager (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.service.pager

## Class RangeNamesQueryPager

- java.lang.Object
- - org.apache.cassandra.service.pager.RangeNamesQueryPager

- All Implemented Interfaces:
    QueryPager

      public class RangeNamesQueryPager
      extends java.lang.Object

  Pages a RangeSliceCommand whose predicate is a name query. Note: this only work for NamesQueryFilter that have countCQL3Rows() set, because this assumes the pageSize is counted in number of internal rows returned. More precisely, this doesn't do in-row paging so this assumes that the counter returned by columnCounter() will count 1 for each internal row.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected CFMetaData` | `cfm`
    `protected IDiskAtomFilter` | `columnFilter`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ColumnCounter` | `columnCounter()`
    `protected boolean` | `containsPreviousLast(Row first)` Checks to see if the first row of a new page contains the last row from the previous page.
    `java.util.List<Row>` | `fetchPage(int pageSize)` Fetches the next page.
    `protected static Cell` | `firstCell(ColumnFamily cf)`
    `boolean` | `isExhausted()` Whether or not this pager is exhausted, i.e.
    `protected boolean` | `isReversed()`
    `protected static Cell` | `lastCell(ColumnFamily cf)`
    `int` | `maxRemaining()` The maximum number of cells/CQL3 row that we may still have to return.
    `protected java.util.List<Row>` | `queryNextPage(int pageSize, ConsistencyLevel consistencyLevel, boolean localQuery)`
    `protected boolean` | `recordLast(Row last)` Saves the paging state by recording the last seen partition key and cell name (where applicable).
    `protected void` | `restoreState(int remaining, boolean shouldFetchExtraRow)`
    `PagingState` | `state()` Get the current state of the pager.
    `long` | `timestamp()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### cfm

          protected final CFMetaData cfm

    - #### columnFilter

          protected final IDiskAtomFilter columnFilter

  - ### Method Detail

    - #### state

          public PagingState state()

      Description copied from interface: `QueryPager`
      Get the current state of the pager. The state can allow to restart the paging on another host from where we are at this point.
      Returns:
        the current paging state. Will return null if paging is at the beginning. If the pager is exhausted, the result is undefined.

    - #### queryNextPage

          protected java.util.List<Row> queryNextPage(int pageSize,
                                          ConsistencyLevel consistencyLevel,
                                          boolean localQuery)
                                               throws RequestExecutionException

      Throws:
        `RequestExecutionException`

    - #### containsPreviousLast

          protected boolean containsPreviousLast(Row first)

      Checks to see if the first row of a new page contains the last row from the previous page.
      Parameters:
        `first` - the first row of the new page
      Returns:
        true if `first` contains the last from from the previous page and it is live, false otherwise

    - #### recordLast

          protected boolean recordLast(Row last)

      Saves the paging state by recording the last seen partition key and cell name (where applicable).
      Parameters:
        `last` - the last row in the current page
      Returns:
        true if an extra row should be fetched in the next page,false otherwise

    - #### isReversed

          protected boolean isReversed()

    - #### fetchPage

          public java.util.List<Row> fetchPage(int pageSize)
                                        throws RequestValidationException,
                                               RequestExecutionException

      Description copied from interface: `QueryPager`
      Fetches the next page.
      Specified by:
        `fetchPage` in interface `QueryPager`
      Parameters:
        `pageSize` - the maximum number of elements to return in the next page.
      Returns:
        the page of result.
      Throws:
        `RequestValidationException`
        `RequestExecutionException`

    - #### restoreState

          protected void restoreState(int remaining,
                          boolean shouldFetchExtraRow)

    - #### isExhausted

          public boolean isExhausted()

      Description copied from interface: `QueryPager`
      Whether or not this pager is exhausted, i.e. whether or not a call to fetchPage may return more result.
      Specified by:
        `isExhausted` in interface `QueryPager`
      Returns:
        whether the pager is exhausted.

    - #### maxRemaining

          public int maxRemaining()

      Description copied from interface: `QueryPager`
      The maximum number of cells/CQL3 row that we may still have to return. In other words, that's the initial user limit minus what we've already returned (note that it's not how many we *will* return, just the upper limit on it).
      Specified by:
        `maxRemaining` in interface `QueryPager`

    - #### timestamp

          public long timestamp()

    - #### columnCounter

          public ColumnCounter columnCounter()

    - #### firstCell

          protected static Cell firstCell(ColumnFamily cf)

    - #### lastCell

          protected static Cell lastCell(ColumnFamily cf)

Copyright © 2014 The Apache Software Foundation