public interface ReadQuery
Modifier and Type | Method and Description |
---|---|
ColumnFilter |
columnFilter()
A filter on which (non-PK) columns must be returned by the query.
|
static ReadQuery |
empty(TableMetadata metadata) |
PartitionIterator |
execute(ConsistencyLevel consistency,
ClientState clientState,
long queryStartNanoTime)
Executes the query at the provided consistency level.
|
PartitionIterator |
executeInternal(ReadExecutionController controller)
Execute the query for internal queries (that is, it basically executes the query locally).
|
UnfilteredPartitionIterator |
executeLocally(ReadExecutionController executionController)
Execute the query locally.
|
ReadExecutionController |
executionController()
Starts a new read operation.
|
QueryPager |
getPager(PagingState pagingState,
ProtocolVersion protocolVersion)
Returns a pager for the query.
|
default boolean |
isEmpty()
Whether this query is known to return nothing upfront.
|
DataLimits |
limits()
The limits for the query.
|
default void |
maybeValidateIndex()
If the index manager for the table determines that there's an applicable
2i that can be used to execute this query, call its (optional)
validation method to check that nothing in this query's parameters
violates the implementation specific validation rules.
|
TableMetadata |
metadata()
The metadata for the table this is a query on.
|
int |
nowInSec()
The time in seconds to use as "now" for this query.
|
RowFilter |
rowFilter()
Filters/Resrictions on CQL rows.
|
boolean |
selectsClustering(DecoratedKey key,
Clustering<?> clustering) |
boolean |
selectsFullPartition()
Checks if this
ReadQuery selects full partitions, that is it has no filtering on clustering or regular columns. |
boolean |
selectsKey(DecoratedKey key) |
static ReadQuery empty(TableMetadata metadata)
TableMetadata metadata()
ReadExecutionController executionController()
This must be called before executeInternal
and passed to it to protect the read.
The returned object must be closed on all path and it is thus strongly advised to
use it in a try-with-ressource construction.
ReadQuery
.PartitionIterator execute(ConsistencyLevel consistency, ClientState clientState, long queryStartNanoTime) throws RequestExecutionException
consistency
- the consistency level to achieve for the query.clientState
- the ClientState
for the query. In practice, this can be null unless
consistency
is a serial consistency.RequestExecutionException
PartitionIterator executeInternal(ReadExecutionController controller)
controller
- the ReadExecutionController
protecting the read.UnfilteredPartitionIterator executeLocally(ReadExecutionController executionController)
executeInternal(ReadExecutionController)
but it returns an unfiltered partition iterator that can be merged later on.executionController
- the ReadExecutionController
protecting the read.QueryPager getPager(PagingState pagingState, ProtocolVersion protocolVersion)
pagingState
- the PagingState
to start from if this is a paging continuation. This can be
null
if this is the start of paging.protocolVersion
- the protocol version to use for the paging state of that pager.DataLimits limits()
boolean selectsKey(DecoratedKey key)
boolean selectsClustering(DecoratedKey key, Clustering<?> clustering)
int nowInSec()
We use the same time as "now" for the whole query to avoid considering different values as expired during the query, which would be buggy (would throw of counting amongst other things).
boolean selectsFullPartition()
ReadQuery
selects full partitions, that is it has no filtering on clustering or regular columns.true
if this ReadQuery
selects full partitions, false
otherwise.RowFilter rowFilter()
This contains the restrictions that are not directly handled by the
ClusteringIndexFilter
. More specifically, this includes any non-PK column
restrictions and can include some PK columns restrictions when those can't be
satisfied entirely by the clustering index filter (because not all clustering columns
have been restricted for instance). If there is 2ndary indexes on the table,
one of this restriction might be handled by a 2ndary index.
ColumnFilter columnFilter()
default boolean isEmpty()
This is overridden by the ReadQuery
created through empty(TableMetadata)
, and that's probably the
only place that should override it.
default void maybeValidateIndex()
Copyright © 2009-2022 The Apache Software Foundation