Class QueryController
- java.lang.Object
-
- org.apache.cassandra.index.sai.plan.QueryController
-
public class QueryController extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description QueryController(ColumnFamilyStore cfs, ReadCommand command, RowFilter filterOperation, QueryContext queryContext, TableQueryMetrics tableQueryMetrics)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<DataRange>
dataRanges()
boolean
doesNotSelect(PrimaryKey key)
Returns whether this query is not selecting thePrimaryKey
.RowFilter
filterOperation()
void
finish()
Used to release all resources and record metrics when query finishes.PrimaryKey
firstPrimaryKeyInRange()
KeyRangeIterator.Builder
getIndexQueryResults(java.util.Collection<Expression> expressions)
Build aKeyRangeIterator.Builder
from the given list ofExpression
s.KeyRangeIterator
getTopKRows(RowFilter.Expression expression)
KeyRangeIterator
getTopKRows(KeyRangeIterator source, RowFilter.Expression expression)
boolean
hasAnalyzer(RowFilter.Expression expression)
StorageAttachedIndex
indexFor(RowFilter.Expression expression)
PrimaryKey
lastPrimaryKeyInRange()
TableMetadata
metadata()
PrimaryKey.Factory
primaryKeyFactory()
UnfilteredRowIterator
queryStorage(PrimaryKey key, ReadExecutionController executionController)
-
-
-
Constructor Detail
-
QueryController
public QueryController(ColumnFamilyStore cfs, ReadCommand command, RowFilter filterOperation, QueryContext queryContext, TableQueryMetrics tableQueryMetrics)
-
-
Method Detail
-
primaryKeyFactory
public PrimaryKey.Factory primaryKeyFactory()
-
firstPrimaryKeyInRange
public PrimaryKey firstPrimaryKeyInRange()
-
lastPrimaryKeyInRange
public PrimaryKey lastPrimaryKeyInRange()
-
metadata
public TableMetadata metadata()
-
filterOperation
public RowFilter filterOperation()
-
dataRanges
public java.util.List<DataRange> dataRanges()
- Returns:
- token ranges used in the read command
-
indexFor
public StorageAttachedIndex indexFor(RowFilter.Expression expression)
-
hasAnalyzer
public boolean hasAnalyzer(RowFilter.Expression expression)
-
queryStorage
public UnfilteredRowIterator queryStorage(PrimaryKey key, ReadExecutionController executionController)
-
getIndexQueryResults
public KeyRangeIterator.Builder getIndexQueryResults(java.util.Collection<Expression> expressions)
Build aKeyRangeIterator.Builder
from the given list ofExpression
s.This is achieved by creating an on-disk view of the query that maps the expressions to the
SSTableIndex
s that will satisfy the expression.Each (expression, SSTable indexes) pair is then passed to
IndexSearchResultIterator.build(Expression, Collection, AbstractBounds, QueryContext)
to search the in-memory index associated with the expression and the SSTable indexes, the results of which are unioned and returned.The results from each call to
IndexSearchResultIterator.build(Expression, Collection, AbstractBounds, QueryContext)
are added to aKeyRangeIntersectionIterator
and returned.
-
doesNotSelect
public boolean doesNotSelect(PrimaryKey key)
Returns whether this query is not selecting thePrimaryKey
. The query does not select the key if both of the following statements are false: 1. The table associated with the query is not using clustering keys 2. The clustering index filter for the command wants the row.Item 2 is important in paged queries where the
ClusteringIndexSliceFilter
for subsequent paged queries may not select rows that are returned by the index search because that is initially partition based.- Parameters:
key
- ThePrimaryKey
to be tested- Returns:
- true if the key is not selected by the query
-
finish
public void finish()
Used to release all resources and record metrics when query finishes.
-
getTopKRows
public KeyRangeIterator getTopKRows(RowFilter.Expression expression)
-
getTopKRows
public KeyRangeIterator getTopKRows(KeyRangeIterator source, RowFilter.Expression expression)
-
-