public class PartitionRangeReadCommand extends ReadCommand implements PartitionRangeReadQuery
ReadCommand.CheckForAbort, ReadCommand.Kind, ReadCommand.SelectionDeserializer, ReadCommand.Serializer
Modifier and Type | Field and Description |
---|---|
protected static ReadCommand.SelectionDeserializer |
selectionDeserializer |
logger, serializer
Modifier and Type | Method and Description |
---|---|
static PartitionRangeReadCommand |
allDataRead(TableMetadata 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.
|
ColumnFilter |
columnFilter()
A filter on which (non-PK) columns must be returned by the query.
|
PartitionRangeReadCommand |
copy()
Returns a copy of this command.
|
protected PartitionRangeReadCommand |
copyAsDigestQuery() |
protected PartitionRangeReadCommand |
copyAsTransientQuery() |
static PartitionRangeReadCommand |
create(TableMetadata metadata,
int nowInSec,
ColumnFilter columnFilter,
RowFilter rowFilter,
DataLimits limits,
DataRange dataRange) |
DataRange |
dataRange() |
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).
|
PartitionRangeReadCommand |
forSubRange(AbstractBounds<PartitionPosition> range,
boolean isRangeContinuation)
Returns an equivalent command but that only queries data within the provided range.
|
long |
getTimeout(java.util.concurrent.TimeUnit unit)
The configured timeout for this command.
|
boolean |
isLimitedToOnePartition() |
boolean |
isNamesQuery() |
boolean |
isRangeRequest() |
boolean |
isReversed()
Whether the underlying
ClusteringIndexFilter is reversed or not. |
DataLimits |
limits()
The limits for the query.
|
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.
|
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.
|
UnfilteredPartitionIterator |
queryStorage(ColumnFamilyStore cfs,
ReadExecutionController executionController) |
protected void |
recordLatency(TableMetrics metric,
long latencyNanos) |
RowFilter |
rowFilter()
Filters/Resrictions on CQL rows.
|
protected long |
selectionSerializedSize(int version) |
protected void |
serializeSelection(DataOutputPlus out,
int version) |
java.lang.String |
toString() |
Verb |
verb() |
PartitionRangeReadCommand |
withUpdatedLimit(DataLimits newLimits)
Creates a new
ReadCommand instance with new limits. |
PartitionRangeReadCommand |
withUpdatedLimitsAndDataRange(DataLimits newLimits,
DataRange newDataRange)
Creates a new
PartitionRangeReadQuery with the updated limits and data range. |
acceptsTransient, copyAsDigestQuery, copyAsDigestQuery, copyAsTransientQuery, copyAsTransientQuery, createMessage, createResponse, digestVersion, executeLocally, executionController, getIndex, getRepairedDataDigest, indexMetadata, isDigestQuery, isRepairedDataDigestConclusive, isTrackingRepairedStatus, maybeValidateIndex, name, oldestUnrepairedTombstone, setDigestVersion, toCQLString, trackRepairedStatus, withoutPurgeableTombstones, withStateTracking
abort, complete, creationTimeNanos, isAborted, isCompleted, isCrossNode, isInProgress, isSlow, setMonitoringTime, slowTimeoutNanos, timeoutNanos
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getPager, selectsClustering, selectsFullPartition, selectsKey
columnFilter, empty, executeInternal, executeLocally, executionController, isEmpty, limits, maybeValidateIndex, metadata, nowInSec, rowFilter
protected static final ReadCommand.SelectionDeserializer selectionDeserializer
public static PartitionRangeReadCommand create(TableMetadata metadata, int nowInSec, ColumnFilter columnFilter, RowFilter rowFilter, DataLimits limits, DataRange dataRange)
create
in interface PartitionRangeReadQuery
public static PartitionRangeReadCommand allDataRead(TableMetadata metadata, int nowInSec)
metadata
- the table to query.nowInSec
- the time in seconds to use are "now" for this query.public DataRange dataRange()
dataRange
in interface PartitionRangeReadQuery
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
protected PartitionRangeReadCommand copyAsDigestQuery()
copyAsDigestQuery
in class ReadCommand
protected PartitionRangeReadCommand copyAsTransientQuery()
copyAsTransientQuery
in class ReadCommand
public PartitionRangeReadCommand withUpdatedLimit(DataLimits newLimits)
ReadCommand
ReadCommand
instance with new limits.withUpdatedLimit
in interface PartitionRangeReadQuery
withUpdatedLimit
in class ReadCommand
newLimits
- the new limitsReadCommand
with the updated limitspublic PartitionRangeReadCommand withUpdatedLimitsAndDataRange(DataLimits newLimits, DataRange newDataRange)
PartitionRangeReadQuery
PartitionRangeReadQuery
with the updated limits and data range.withUpdatedLimitsAndDataRange
in interface PartitionRangeReadQuery
newLimits
- the new limitsPartitionRangeReadQuery
public long getTimeout(java.util.concurrent.TimeUnit unit)
ReadCommand
getTimeout
in class ReadCommand
public boolean isReversed()
ReadCommand
ClusteringIndexFilter
is reversed or not.isReversed
in class ReadCommand
ClusteringIndexFilter
is reversed or not.public PartitionIterator execute(ConsistencyLevel consistency, ClientState clientState, long queryStartNanoTime) throws RequestExecutionException
ReadQuery
execute
in interface 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
protected void recordLatency(TableMetrics metric, long latencyNanos)
recordLatency
in class ReadCommand
public UnfilteredPartitionIterator queryStorage(ColumnFamilyStore cfs, ReadExecutionController executionController)
queryStorage
in class ReadCommand
public Verb verb()
verb
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
public boolean isLimitedToOnePartition()
isLimitedToOnePartition
in class ReadCommand
public boolean isRangeRequest()
isRangeRequest
in class ReadCommand
public TableMetadata metadata()
ReadQuery
public PartitionIterator executeInternal(ReadExecutionController controller)
ReadQuery
executeInternal
in interface ReadQuery
controller
- the ReadExecutionController
protecting the read.public DataLimits limits()
ReadQuery
public int nowInSec()
ReadQuery
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).
public RowFilter rowFilter()
ReadQuery
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.
public ColumnFilter columnFilter()
ReadQuery
columnFilter
in interface ReadQuery
Copyright © 2009-2021 The Apache Software Foundation