Class PartitionRangeQueryPager

  • All Implemented Interfaces:
    QueryPager

    public class PartitionRangeQueryPager
    extends java.lang.Object
    Pages a PartitionRangeReadQuery.
    • Method Detail

      • withUpdatedLimit

        public PartitionRangeQueryPager withUpdatedLimit​(DataLimits newLimits)
        Description copied from interface: QueryPager
        Creates a new QueryPager that use the new limits.
        Parameters:
        newLimits - the new limits
        Returns:
        a new QueryPager that use the new limits
      • 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.
      • isPreviouslyReturnedPartition

        protected boolean isPreviouslyReturnedPartition​(DecoratedKey key)
      • isTopK

        public boolean isTopK()
        Returns:
        true given read query is a top-k request
      • fetchPage

        public PartitionIterator fetchPage​(int pageSize,
                                           ConsistencyLevel consistency,
                                           ClientState clientState,
                                           Dispatcher.RequestTime requestTime)
        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.
        consistency - the consistency level to achieve for the query.
        clientState - the ClientState for the query. In practice, this can be null unless consistency is a serial consistency.
        Returns:
        the page of result.
      • fetchPageInternal

        public PartitionIterator fetchPageInternal​(int pageSize,
                                                   ReadExecutionController executionController)
        Description copied from interface: QueryPager
        Fetches the next page internally (in other, this does a local query).
        Specified by:
        fetchPageInternal in interface QueryPager
        Parameters:
        pageSize - the maximum number of elements to return in the next page.
        executionController - the ReadExecutionController protecting the read.
        Returns:
        the page of result.
      • restoreState

        protected void restoreState​(DecoratedKey lastKey,
                                    int remaining,
                                    int remainingInPartition)
      • 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
      • remainingInPartition

        protected int remainingInPartition()