Class DataRange.Paging

  • Enclosing class:
    DataRange

    public static class DataRange.Paging
    extends DataRange
    Specialized DataRange used for the paging case.

    It uses the clustering of the last result of the previous page to restrict the filter on the first queried partition (the one for that last result) so it only fetch results that follow that last result. In other words, this makes sure this resume paging where we left off.

    • Method Detail

      • clusteringIndexFilter

        public ClusteringIndexFilter clusteringIndexFilter​(DecoratedKey key)
        Description copied from class: DataRange
        The clustering index filter to use for the provided key.

        This may or may not be the same filter for all keys (that is, paging range use a different filter for their start key).

        Overrides:
        clusteringIndexFilter in class DataRange
        Parameters:
        key - the partition key for which we want the clustering index filter.
        Returns:
        the clustering filter to use for key.
      • forSubRange

        public DataRange forSubRange​(AbstractBounds<PartitionPosition> range)
        Description copied from class: DataRange
        Returns a new DataRange equivalent to this one but restricted to the provided sub-range.
        Overrides:
        forSubRange in class DataRange
        Parameters:
        range - the sub-range to use for the newly returned data range. Note that assumes that range is a proper sub-range of the initial range but doesn't validate it. You should make sure to only provided sub-ranges however or this might throw off the paging case (see Paging.forSubRange()).
        Returns:
        a new DataRange using range as partition key range and the clustering index filter filter from this.
      • getLastReturned

        public Clustering<?> getLastReturned()
        Returns:
        the last Clustering that was returned (in the previous page)
      • isPaging

        public boolean isPaging()
        Description copied from class: DataRange
        Whether the data range is for a paged request or not.
        Overrides:
        isPaging in class DataRange
        Returns:
        true if for paging, false otherwise
      • isUnrestricted

        public boolean isUnrestricted​(TableMetadata metadata)
        Description copied from class: DataRange
        Whether this DataRange queries everything (has no restriction neither on the partition queried, nor within the queried partition).
        Overrides:
        isUnrestricted in class DataRange
        Returns:
        Whether this DataRange queries everything.