Package 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
SpecializedDataRange
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 Modifier and Type Method Description ClusteringIndexFilter
clusteringIndexFilter(DecoratedKey key)
The clustering index filter to use for the provided key.DataRange
forSubRange(AbstractBounds<PartitionPosition> range)
Returns a newDataRange
equivalent tothis
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(TableMetadata metadata)
Whether thisDataRange
queries everything (has no restriction neither on the partition queried, nor within the queried partition).java.lang.String
toString(TableMetadata metadata)
-
Methods inherited from class org.apache.cassandra.db.DataRange
allData, allData, appendKeyString, contains, forKeyRange, forPaging, forTokenRange, isNamesQuery, isReversed, isWrapAround, keyRange, selectsAllPartition, startAsByteComparable, startKey, stopAsByteComparable, stopKey, toCQLString
-
-
-
-
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 classDataRange
- 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 newDataRange
equivalent tothis
one but restricted to the provided sub-range.- Overrides:
forSubRange
in classDataRange
- Parameters:
range
- the sub-range to use for the newly returned data range. Note that assumes thatrange
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
usingrange
as partition key range and the clustering index filter filter fromthis
.
-
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.
-
isUnrestricted
public boolean isUnrestricted(TableMetadata metadata)
Description copied from class:DataRange
Whether thisDataRange
queries everything (has no restriction neither on the partition queried, nor within the queried partition).- Overrides:
isUnrestricted
in classDataRange
- Returns:
- Whether this
DataRange
queries everything.
-
toString
public java.lang.String toString(TableMetadata metadata)
-
-