org.apache.cassandra.db

## Class DataRange.Paging

- java.lang.Object
- - org.apache.cassandra.db.DataRange
  - - org.apache.cassandra.db.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.

### Nested Class Summary

### Nested classes/interfaces inherited from class org.apache.cassandra.db.DataRange

`DataRange.Paging, DataRange.Serializer`

### Field Summary

### Fields inherited from class org.apache.cassandra.db.DataRange

`clusteringIndexFilter, keyRange, serializer`

### Method Summary

All Methods Instance Methods Concrete Methods
`ClusteringIndexFilter` `clusteringIndexFilter(DecoratedKey key)` The clustering index filter to use for the provided key.
`DataRange` `forSubRange(AbstractBounds<PartitionPosition> range)` Returns a new `DataRange` equivalent to `this` one but restricted to the provided sub-range.
`Clustering` `getLastReturned()`
`boolean` `isPaging()` Whether the data range is for a paged request or not.
`boolean` `isUnrestricted()` Whether this `DataRange` queries everything (has no restriction neither on the partition queried, nor within the queried partition).
`java.lang.String` `toString(CFMetaData metadata)`

### Methods inherited from class org.apache.cassandra.db.DataRange

`allData, allData, appendKeyString, contains, forKeyRange, forPaging, forTokenRange, isNamesQuery, isWrapAround, keyRange, selectsAllPartition, startKey, stopKey, toCQLString`

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

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

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

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.

#### toString

    public java.lang.String toString(CFMetaData metadata)

Overrides:
  `toString` in class `DataRange`