public interface ReadQuery
The main implementation of this is ReadCommand
but we have this interface because
SinglePartitionReadCommand.Group
is also consider as a "read query" but is not a
ReadCommand
.
Modifier and Type | Method and Description |
---|---|
PartitionIterator |
execute(ConsistencyLevel consistency,
ClientState clientState)
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).
|
ReadExecutionController |
executionController()
Starts a new read operation.
|
QueryPager |
getPager(PagingState pagingState,
int protocolVersion)
Returns a pager for the query.
|
DataLimits |
limits()
The limits for the query.
|
boolean |
selectsClustering(DecoratedKey key,
Clustering clustering) |
boolean |
selectsKey(DecoratedKey key) |
static final ReadQuery EMPTY
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) 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.QueryPager getPager(PagingState pagingState, int 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)
Copyright © 2016 The Apache Software Foundation