Class VirtualTablePartitionRangeReadQuery
- java.lang.Object
-
- org.apache.cassandra.db.monitoring.MonitorableImpl
-
- org.apache.cassandra.db.VirtualTableReadQuery
-
- org.apache.cassandra.db.VirtualTablePartitionRangeReadQuery
-
- All Implemented Interfaces:
Monitorable,PartitionRangeReadQuery,ReadQuery
public class VirtualTablePartitionRangeReadQuery extends VirtualTableReadQuery implements PartitionRangeReadQuery
A read query that selects a (part of a) range of partitions of a virtual table.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendCQLWhereClause(java.lang.StringBuilder sb)ColumnFiltercolumnFilter()A filter on which (non-PK) columns must be returned by the query.static VirtualTablePartitionRangeReadQuerycreate(TableMetadata metadata, int nowInSec, ColumnFilter columnFilter, RowFilter rowFilter, DataLimits limits, DataRange dataRange)DataRangedataRange()PartitionIteratorexecuteInternal(ReadExecutionController controller)Execute the query for internal queries (that is, it basically executes the query locally).DataLimitslimits()The limits for the query.TableMetadatametadata()The metadata for the table this is a query on.java.lang.Stringname()intnowInSec()The time in seconds to use as "now" for this query.protected UnfilteredPartitionIteratorqueryVirtualTable()RowFilterrowFilter()Filters/Resrictions on CQL rows.java.lang.StringtoCQLString()Recreate the CQL string corresponding to this query.PartitionRangeReadQuerywithUpdatedLimit(DataLimits newLimits)Creates a newPartitionRangeReadQuerywith the updated limits.PartitionRangeReadQuerywithUpdatedLimitsAndDataRange(DataLimits newLimits, DataRange newDataRange)Creates a newPartitionRangeReadQuerywith the updated limits and data range.-
Methods inherited from class org.apache.cassandra.db.VirtualTableReadQuery
execute, executeLocally, executionController
-
Methods inherited from class org.apache.cassandra.db.monitoring.MonitorableImpl
abort, complete, creationTimeNanos, isAborted, isCompleted, isCrossNode, isInProgress, isSlow, setMonitoringTime, slowTimeoutNanos, timeoutNanos
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.db.PartitionRangeReadQuery
getPager, selectsClustering, selectsFullPartition, selectsKey
-
Methods inherited from interface org.apache.cassandra.db.ReadQuery
columnFilter, execute, executeInternal, executeLocally, executionController, isEmpty, limits, maybeValidateIndex, metadata, nowInSec, rowFilter
-
-
-
-
Method Detail
-
create
public static VirtualTablePartitionRangeReadQuery create(TableMetadata metadata, int nowInSec, ColumnFilter columnFilter, RowFilter rowFilter, DataLimits limits, DataRange dataRange)
-
dataRange
public DataRange dataRange()
- Specified by:
dataRangein interfacePartitionRangeReadQuery
-
withUpdatedLimit
public PartitionRangeReadQuery withUpdatedLimit(DataLimits newLimits)
Description copied from interface:PartitionRangeReadQueryCreates a newPartitionRangeReadQuerywith the updated limits.- Specified by:
withUpdatedLimitin interfacePartitionRangeReadQuery- Parameters:
newLimits- the new limits- Returns:
- the new
PartitionRangeReadQuery
-
withUpdatedLimitsAndDataRange
public PartitionRangeReadQuery withUpdatedLimitsAndDataRange(DataLimits newLimits, DataRange newDataRange)
Description copied from interface:PartitionRangeReadQueryCreates a newPartitionRangeReadQuerywith the updated limits and data range.- Specified by:
withUpdatedLimitsAndDataRangein interfacePartitionRangeReadQuery- Parameters:
newLimits- the new limits- Returns:
- the new
PartitionRangeReadQuery
-
queryVirtualTable
protected UnfilteredPartitionIterator queryVirtualTable()
- Specified by:
queryVirtualTablein classVirtualTableReadQuery
-
appendCQLWhereClause
protected void appendCQLWhereClause(java.lang.StringBuilder sb)
-
metadata
public TableMetadata metadata()
Description copied from interface:ReadQueryThe metadata for the table this is a query on.
-
name
public java.lang.String name()
- Specified by:
namein interfaceMonitorable
-
executeInternal
public PartitionIterator executeInternal(ReadExecutionController controller)
Description copied from interface:ReadQueryExecute the query for internal queries (that is, it basically executes the query locally).- Specified by:
executeInternalin interfaceReadQuery- Parameters:
controller- theReadExecutionControllerprotecting the read.- Returns:
- the result of the query.
-
limits
public DataLimits limits()
Description copied from interface:ReadQueryThe limits for the query.
-
nowInSec
public int nowInSec()
Description copied from interface:ReadQueryThe time in seconds to use as "now" for this query.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).
-
rowFilter
public RowFilter rowFilter()
Description copied from interface:ReadQueryFilters/Resrictions on CQL rows.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.
-
columnFilter
public ColumnFilter columnFilter()
Description copied from interface:ReadQueryA filter on which (non-PK) columns must be returned by the query.- Specified by:
columnFilterin interfaceReadQuery- Returns:
- which columns must be fetched by this query.
-
toCQLString
public java.lang.String toCQLString()
Recreate the CQL string corresponding to this query.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.
-
-