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(ReadOrderGroup orderGroup)
Execute the query for internal queries (that is, it basically executes the query locally).
|
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) |
ReadOrderGroup |
startOrderGroup()
Starts a new read operation.
|
static final ReadQuery EMPTY
ReadOrderGroup startOrderGroup()
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(ReadOrderGroup orderGroup)
orderGroup
- the ReadOrderGroup
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 © 2017 The Apache Software Foundation