public class VirtualTableSinglePartitionReadQuery extends VirtualTableReadQuery implements SinglePartitionReadQuery
| Modifier and Type | Class and Description |
|---|---|
static class |
VirtualTableSinglePartitionReadQuery.Group
Groups multiple single partition read queries.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendCQLWhereClause(java.lang.StringBuilder sb) |
ClusteringIndexFilter |
clusteringIndexFilter() |
ColumnFilter |
columnFilter()
A filter on which (non-PK) columns must be returned by the query.
|
static VirtualTableSinglePartitionReadQuery |
create(TableMetadata metadata,
int nowInSec,
ColumnFilter columnFilter,
RowFilter rowFilter,
DataLimits limits,
DecoratedKey partitionKey,
ClusteringIndexFilter clusteringIndexFilter)
Creates a new read query on a single partition.
|
PartitionIterator |
executeInternal(ReadExecutionController controller)
Execute the query for internal queries (that is, it basically executes the query locally).
|
SinglePartitionReadQuery |
forPaging(Clustering<?> lastReturned,
DataLimits limits)
Returns a new
SinglePartitionReadQuery suitable to paging from the last returned row. |
DataLimits |
limits()
The limits for the query.
|
TableMetadata |
metadata()
The metadata for the table this is a query on.
|
java.lang.String |
name() |
int |
nowInSec()
The time in seconds to use as "now" for this query.
|
DecoratedKey |
partitionKey()
Returns the key of the partition queried by this
ReadQuery |
protected UnfilteredPartitionIterator |
queryVirtualTable() |
RowFilter |
rowFilter()
Filters/Resrictions on CQL rows.
|
boolean |
selectsFullPartition()
Checks if this
ReadQuery selects full partitions, that is it has no filtering on clustering or regular columns. |
java.lang.String |
toCQLString()
Recreate the CQL string corresponding to this query.
|
SinglePartitionReadQuery |
withUpdatedLimit(DataLimits newLimits)
Creates a new
SinglePartitionReadQuery with the specified limits. |
execute, executeLocally, executionControllerabort, complete, creationTimeNanos, isAborted, isCompleted, isCrossNode, isInProgress, isSlow, setMonitoringTime, slowTimeoutNanos, timeoutNanosclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, createGroup, getPager, selectsClustering, selectsKeycolumnFilter, empty, execute, executeInternal, executeLocally, executionController, isEmpty, limits, maybeValidateIndex, metadata, nowInSec, rowFilterpublic static VirtualTableSinglePartitionReadQuery create(TableMetadata metadata, int nowInSec, ColumnFilter columnFilter, RowFilter rowFilter, DataLimits limits, DecoratedKey partitionKey, ClusteringIndexFilter clusteringIndexFilter)
SinglePartitionReadQuerycreate in interface SinglePartitionReadQuerymetadata - the table to query.nowInSec - the time in seconds to use are "now" for this query.columnFilter - the column filter to use for the query.rowFilter - the row filter to use for the query.limits - the limits to use for the query.partitionKey - the partition key for the partition to query.clusteringIndexFilter - the clustering index filter to use for the query.protected void appendCQLWhereClause(java.lang.StringBuilder sb)
public ClusteringIndexFilter clusteringIndexFilter()
clusteringIndexFilter in interface SinglePartitionReadQuerypublic boolean selectsFullPartition()
ReadQueryReadQuery selects full partitions, that is it has no filtering on clustering or regular columns.selectsFullPartition in interface ReadQuerytrue if this ReadQuery selects full partitions, false otherwise.public DecoratedKey partitionKey()
SinglePartitionReadQueryReadQuerypartitionKey in interface SinglePartitionReadQuerypublic SinglePartitionReadQuery withUpdatedLimit(DataLimits newLimits)
SinglePartitionReadQuerySinglePartitionReadQuery with the specified limits.withUpdatedLimit in interface SinglePartitionReadQuerynewLimits - the new limitsSinglePartitionReadQuerypublic SinglePartitionReadQuery forPaging(Clustering<?> lastReturned, DataLimits limits)
SinglePartitionReadQuerySinglePartitionReadQuery suitable to paging from the last returned row.forPaging in interface SinglePartitionReadQuerylastReturned - the last row returned by the previous page. The newly created query
will only query row that comes after this (in query order). This can be null if this
is the first page.limits - the limits to use for the page to query.protected UnfilteredPartitionIterator queryVirtualTable()
queryVirtualTable in class VirtualTableReadQuerypublic TableMetadata metadata()
ReadQuerypublic java.lang.String name()
name in interface Monitorablepublic PartitionIterator executeInternal(ReadExecutionController controller)
ReadQueryexecuteInternal in interface ReadQuerycontroller - the ReadExecutionController protecting the read.public DataLimits limits()
ReadQuerypublic int nowInSec()
ReadQueryWe 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()
ReadQuerycolumnFilter in interface ReadQuerypublic java.lang.String toCQLString()
Note that in general the returned string will not be exactly the original user string, first because there isn't always a single syntax for a given query, but also because we don't have all the information needed (we know the non-PK columns queried but not the PK ones as internally we query them all). So this shouldn't be relied too strongly, but this should be good enough for debugging purpose which is what this is for.
Copyright © 2009-2022 The Apache Software Foundation