public class PartitionRangeReadCommand extends ReadCommand
ReadCommand.CheckForAbort, ReadCommand.Kind, ReadCommand.SelectionDeserializer
Modifier and Type | Field and Description |
---|---|
protected static ReadCommand.SelectionDeserializer |
selectionDeserializer |
index, legacyPagedRangeCommandSerializer, legacyRangeSliceCommandSerializer, legacyReadCommandSerializer, logger, pagedRangeSerializer, rangeSliceSerializer, readSerializer, serializer
Constructor and Description |
---|
PartitionRangeReadCommand(boolean isDigest,
int digestVersion,
boolean isForThrift,
CFMetaData metadata,
int nowInSec,
ColumnFilter columnFilter,
RowFilter rowFilter,
DataLimits limits,
DataRange dataRange,
java.util.Optional<IndexMetadata> index) |
PartitionRangeReadCommand(CFMetaData metadata,
int nowInSec,
ColumnFilter columnFilter,
RowFilter rowFilter,
DataLimits limits,
DataRange dataRange,
java.util.Optional<IndexMetadata> index) |
Modifier and Type | Method and Description |
---|---|
static PartitionRangeReadCommand |
allDataRead(CFMetaData metadata,
int nowInSec)
Creates a new read command that query all the data in the table.
|
protected void |
appendCQLWhereClause(java.lang.StringBuilder sb) |
ClusteringIndexFilter |
clusteringIndexFilter(DecoratedKey key)
The clustering index filter this command to use for the provided key.
|
PartitionRangeReadCommand |
copy()
Returns a copy of this command.
|
MessageOut<ReadCommand> |
createMessage(int version)
Creates a message for this command.
|
DataRange |
dataRange() |
PartitionIterator |
execute(ConsistencyLevel consistency,
ClientState clientState,
long queryStartNanoTime)
Executes the query at the provided consistency level.
|
PartitionRangeReadCommand |
forSubRange(AbstractBounds<PartitionPosition> range,
boolean isRangeContinuation)
Returns an equivalent command but that only queries data within the provided range.
|
QueryPager |
getPager(PagingState pagingState,
ProtocolVersion protocolVersion)
Returns a pager for the query.
|
long |
getTimeout()
The configured timeout for this command.
|
boolean |
isNamesQuery() |
protected int |
oldestUnrepairedTombstone() |
PartitionIterator |
postReconciliationProcessing(PartitionIterator result)
Allow to post-process the result of the query after it has been reconciled on the coordinator
but before it is passed to the CQL layer to return the ResultSet.
|
protected UnfilteredPartitionIterator |
queryStorage(ColumnFamilyStore cfs,
ReadExecutionController executionController) |
protected void |
recordLatency(TableMetrics metric,
long latencyNanos) |
protected long |
selectionSerializedSize(int version) |
boolean |
selectsClustering(DecoratedKey key,
Clustering clustering) |
boolean |
selectsKey(DecoratedKey key) |
protected void |
serializeSelection(DataOutputPlus out,
int version) |
java.lang.String |
toString() |
PartitionRangeReadCommand |
withUpdatedLimit(DataLimits newLimits)
Creates a new
ReadCommand instance with new limits. |
columnFilter, createResponse, digestVersion, executeInternal, executeLocally, executionController, getIndex, indexSerializedSize, isDigestQuery, isForThrift, limits, maybeValidateIndex, metadata, name, nowInSec, rowFilter, setDigestVersion, setIsDigestQuery, toCQLString, withoutPurgeableTombstones, withStateTracking
abort, complete, constructionTime, isAborted, isCompleted, isCrossNode, isInProgress, isSlow, setMonitoringTime, slowTimeout, timeout
protected static final ReadCommand.SelectionDeserializer selectionDeserializer
public PartitionRangeReadCommand(boolean isDigest, int digestVersion, boolean isForThrift, CFMetaData metadata, int nowInSec, ColumnFilter columnFilter, RowFilter rowFilter, DataLimits limits, DataRange dataRange, java.util.Optional<IndexMetadata> index)
public PartitionRangeReadCommand(CFMetaData metadata, int nowInSec, ColumnFilter columnFilter, RowFilter rowFilter, DataLimits limits, DataRange dataRange, java.util.Optional<IndexMetadata> index)
public static PartitionRangeReadCommand allDataRead(CFMetaData metadata, int nowInSec)
metadata
- the table to query.nowInSec
- the time in seconds to use are "now" for this query.public DataRange dataRange()
public ClusteringIndexFilter clusteringIndexFilter(DecoratedKey key)
ReadCommand
Note that that method should only be called on a key actually queried by this command and in practice, this will almost always return the same filter, but for the sake of paging, the filter on the first key of a range command might be slightly different.
clusteringIndexFilter
in class ReadCommand
key
- a partition key queried by this command.ClusteringIndexFilter
to use for the partition of key key
.public boolean isNamesQuery()
public PartitionRangeReadCommand forSubRange(AbstractBounds<PartitionPosition> range, boolean isRangeContinuation)
range
- the sub-range to restrict the command to. This method assumes that this is a proper sub-range
of the command this is applied to.isRangeContinuation
- whether range
is a direct continuation of whatever previous range we have
queried. This matters for the DataLimits
that may contain states when we do paging and in the context of
parallel queries: that state only make sense if the range queried is indeed the follow-up of whatever range we've
previously query (that yield said state). In practice this means that ranges for which isRangeContinuation
is false may have to be slightly pessimistic when counting data and may include a little bit than necessary, and
this should be dealt with post-query (in the case of StorageProxy.getRangeSlice()
, which uses this method
for replica queries, this is dealt with by re-counting results on the coordinator). Note that if this is the
first range we queried, then the DataLimits
will have not state and the value of this parameter doesn't
matter.public PartitionRangeReadCommand copy()
ReadCommand
copy
in class ReadCommand
public PartitionRangeReadCommand withUpdatedLimit(DataLimits newLimits)
ReadCommand
ReadCommand
instance with new limits.withUpdatedLimit
in class ReadCommand
newLimits
- the new limitsReadCommand
with the updated limitspublic long getTimeout()
ReadCommand
getTimeout
in class ReadCommand
public boolean selectsKey(DecoratedKey key)
public boolean selectsClustering(DecoratedKey key, Clustering clustering)
public PartitionIterator execute(ConsistencyLevel consistency, ClientState clientState, long queryStartNanoTime) throws RequestExecutionException
ReadQuery
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
public QueryPager getPager(PagingState pagingState, ProtocolVersion protocolVersion)
ReadQuery
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.protected void recordLatency(TableMetrics metric, long latencyNanos)
recordLatency
in class ReadCommand
protected UnfilteredPartitionIterator queryStorage(ColumnFamilyStore cfs, ReadExecutionController executionController)
queryStorage
in class ReadCommand
protected int oldestUnrepairedTombstone()
oldestUnrepairedTombstone
in class ReadCommand
public MessageOut<ReadCommand> createMessage(int version)
ReadCommand
createMessage
in class ReadCommand
protected void appendCQLWhereClause(java.lang.StringBuilder sb)
appendCQLWhereClause
in class ReadCommand
public PartitionIterator postReconciliationProcessing(PartitionIterator result)
public java.lang.String toString()
toString
in class java.lang.Object
protected void serializeSelection(DataOutputPlus out, int version) throws java.io.IOException
serializeSelection
in class ReadCommand
java.io.IOException
protected long selectionSerializedSize(int version)
selectionSerializedSize
in class ReadCommand
Copyright © 2017 The Apache Software Foundation