Package org.apache.cassandra.db
Interface SinglePartitionReadQuery
-
- All Superinterfaces:
ReadQuery
- All Known Implementing Classes:
SinglePartitionReadCommand
,SinglePartitionReadCommand.VirtualTableSinglePartitionReadCommand
public interface SinglePartitionReadQuery extends ReadQuery
AReadQuery
for a single partition.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
SinglePartitionReadQuery.Group<T extends SinglePartitionReadQuery>
Groups multiple single partition read queries.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ClusteringIndexFilter
clusteringIndexFilter()
static SinglePartitionReadQuery
create(TableMetadata metadata, long nowInSec, DecoratedKey key, ColumnFilter columnFilter, ClusteringIndexFilter filter)
Creates a new read query on a single partition.static SinglePartitionReadQuery
create(TableMetadata metadata, long nowInSec, ColumnFilter columnFilter, RowFilter rowFilter, DataLimits limits, DecoratedKey partitionKey, ClusteringIndexFilter clusteringIndexFilter)
Creates a new read query on a single partition.static SinglePartitionReadQuery.Group<? extends SinglePartitionReadQuery>
createGroup(TableMetadata metadata, long nowInSec, ColumnFilter columnFilter, RowFilter rowFilter, DataLimits limits, java.util.List<DecoratedKey> partitionKeys, ClusteringIndexFilter clusteringIndexFilter)
SinglePartitionReadQuery
forPaging(Clustering<?> lastReturned, DataLimits limits)
Returns a newSinglePartitionReadQuery
suitable to paging from the last returned row.default SinglePartitionPager
getPager(PagingState pagingState, ProtocolVersion protocolVersion)
Returns a pager for the query.DecoratedKey
partitionKey()
Returns the key of the partition queried by thisReadQuery
default boolean
selectsClustering(DecoratedKey key, Clustering<?> clustering)
default boolean
selectsKey(DecoratedKey key)
SinglePartitionReadQuery
withUpdatedLimit(DataLimits newLimits)
Creates a newSinglePartitionReadQuery
with the specified limits.-
Methods inherited from interface org.apache.cassandra.db.ReadQuery
columnFilter, execute, executeInternal, executeLocally, executionController, isEmpty, isTopK, limits, maybeValidateIndex, metadata, nowInSec, rowFilter, selectsFullPartition, trackWarnings
-
-
-
-
Method Detail
-
createGroup
static SinglePartitionReadQuery.Group<? extends SinglePartitionReadQuery> createGroup(TableMetadata metadata, long nowInSec, ColumnFilter columnFilter, RowFilter rowFilter, DataLimits limits, java.util.List<DecoratedKey> partitionKeys, ClusteringIndexFilter clusteringIndexFilter)
-
create
static SinglePartitionReadQuery create(TableMetadata metadata, long nowInSec, DecoratedKey key, ColumnFilter columnFilter, ClusteringIndexFilter filter)
Creates a new read query on a single partition.- Parameters:
metadata
- the table to query.nowInSec
- the time in seconds to use are "now" for this query.key
- the partition key for the partition to query.columnFilter
- the column filter to use for the query.filter
- the clustering index filter to use for the query.- Returns:
- a newly created read query. The returned query will use no row filter and have no limits.
-
create
static SinglePartitionReadQuery create(TableMetadata metadata, long nowInSec, ColumnFilter columnFilter, RowFilter rowFilter, DataLimits limits, DecoratedKey partitionKey, ClusteringIndexFilter clusteringIndexFilter)
Creates a new read query on a single partition.- Parameters:
metadata
- the table to query.nowInSec
- the time in seconds to use are "now" for this query.columnFilter
- the column filter to use for the query.rowFilter
- the row filter to use for the query.limits
- the limits to use for the query.partitionKey
- the partition key for the partition to query.clusteringIndexFilter
- the clustering index filter to use for the query.- Returns:
- a newly created read query.
-
partitionKey
DecoratedKey partitionKey()
Returns the key of the partition queried by thisReadQuery
- Returns:
- the key of the partition queried
-
withUpdatedLimit
SinglePartitionReadQuery withUpdatedLimit(DataLimits newLimits)
Creates a newSinglePartitionReadQuery
with the specified limits.- Parameters:
newLimits
- the new limits- Returns:
- the new
SinglePartitionReadQuery
-
forPaging
SinglePartitionReadQuery forPaging(Clustering<?> lastReturned, DataLimits limits)
Returns a newSinglePartitionReadQuery
suitable to paging from the last returned row.- Parameters:
lastReturned
- the last row returned by the previous page. The newly created query will only query row that comes after this (in query order). This can benull
if this is the first page.limits
- the limits to use for the page to query.- Returns:
- the newly create query.
-
getPager
default SinglePartitionPager getPager(PagingState pagingState, ProtocolVersion protocolVersion)
Description copied from interface:ReadQuery
Returns a pager for the query.
-
clusteringIndexFilter
ClusteringIndexFilter clusteringIndexFilter()
-
selectsKey
default boolean selectsKey(DecoratedKey key)
- Specified by:
selectsKey
in interfaceReadQuery
- Returns:
- true if the read query would select the given key, including checks against the row filter, if checkRowFilter is true
-
selectsClustering
default boolean selectsClustering(DecoratedKey key, Clustering<?> clustering)
- Specified by:
selectsClustering
in interfaceReadQuery
- Returns:
- true if the read query would select the given clustering, including checks against the row filter, if checkRowFilter is true
-
-