Package org.apache.cassandra.db
Interface SinglePartitionReadQuery
-
- All Superinterfaces:
ReadQuery
- All Known Implementing Classes:
SinglePartitionReadCommand,SinglePartitionReadCommand.VirtualTableSinglePartitionReadCommand
public interface SinglePartitionReadQuery extends ReadQuery
AReadQueryfor a single partition.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSinglePartitionReadQuery.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 ClusteringIndexFilterclusteringIndexFilter()static SinglePartitionReadQuerycreate(TableMetadata metadata, int nowInSec, DecoratedKey key, ColumnFilter columnFilter, ClusteringIndexFilter filter)Creates a new read query on a single partition.static SinglePartitionReadQuerycreate(TableMetadata metadata, int 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, int nowInSec, ColumnFilter columnFilter, RowFilter rowFilter, DataLimits limits, java.util.List<DecoratedKey> partitionKeys, ClusteringIndexFilter clusteringIndexFilter)SinglePartitionReadQueryforPaging(Clustering<?> lastReturned, DataLimits limits)Returns a newSinglePartitionReadQuerysuitable to paging from the last returned row.default SinglePartitionPagergetPager(PagingState pagingState, ProtocolVersion protocolVersion)Returns a pager for the query.DecoratedKeypartitionKey()Returns the key of the partition queried by thisReadQuerydefault booleanselectsClustering(DecoratedKey key, Clustering<?> clustering)default booleanselectsKey(DecoratedKey key)SinglePartitionReadQuerywithUpdatedLimit(DataLimits newLimits)Creates a newSinglePartitionReadQuerywith the specified limits.-
Methods inherited from interface org.apache.cassandra.db.ReadQuery
columnFilter, execute, executeInternal, executeLocally, executionController, isEmpty, limits, maybeValidateIndex, metadata, nowInSec, rowFilter, selectsFullPartition, trackWarnings
-
-
-
-
Method Detail
-
createGroup
static SinglePartitionReadQuery.Group<? extends SinglePartitionReadQuery> createGroup(TableMetadata metadata, int nowInSec, ColumnFilter columnFilter, RowFilter rowFilter, DataLimits limits, java.util.List<DecoratedKey> partitionKeys, ClusteringIndexFilter clusteringIndexFilter)
-
create
static SinglePartitionReadQuery create(TableMetadata metadata, int 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, int 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 newSinglePartitionReadQuerywith the specified limits.- Parameters:
newLimits- the new limits- Returns:
- the new
SinglePartitionReadQuery
-
forPaging
SinglePartitionReadQuery forPaging(Clustering<?> lastReturned, DataLimits limits)
Returns a newSinglePartitionReadQuerysuitable 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 benullif 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:ReadQueryReturns a pager for the query.
-
clusteringIndexFilter
ClusteringIndexFilter clusteringIndexFilter()
-
selectsKey
default boolean selectsKey(DecoratedKey key)
- Specified by:
selectsKeyin 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:
selectsClusteringin interfaceReadQuery- Returns:
- true if the read query would select the given clustering, including checks against the row filter, if checkRowFilter is true
-
-