Package org.apache.cassandra.index
Class SingletonIndexQueryPlan
- java.lang.Object
-
- org.apache.cassandra.index.SingletonIndexQueryPlan
-
- All Implemented Interfaces:
java.lang.Comparable<Index.QueryPlan>
,Index.QueryPlan
- Direct Known Subclasses:
SASIIndexQueryPlan
public class SingletonIndexQueryPlan extends java.lang.Object implements Index.QueryPlan
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SingletonIndexQueryPlan(Index index, RowFilter postIndexFilter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static SingletonIndexQueryPlan
create(Index index, RowFilter rowFilter)
long
getEstimatedResultRows()
Return an estimate of the number of results this plan is expected to return for any givenReadCommand
that it can be used to answer.Index
getFirst()
Returns the first index in this plan.java.util.Set<Index>
getIndexes()
Returns the indexes selected by this query plan, all of them belonging to the sameIndex.Group
.RowFilter
postIndexQueryFilter()
Transform an initialRowFilter
into the filter that will still need to applied to a set of Rows after the index has performed it's initial scan.Index.Searcher
searcherFor(ReadCommand command)
Factory method for query time search helper.-
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.index.Index.QueryPlan
compareTo, isTopK, postProcessor, shouldEstimateInitialConcurrency, supportsReplicaFilteringProtection, validate
-
-
-
-
Method Detail
-
create
@Nullable protected static SingletonIndexQueryPlan create(Index index, RowFilter rowFilter)
-
getIndexes
public java.util.Set<Index> getIndexes()
Description copied from interface:Index.QueryPlan
Returns the indexes selected by this query plan, all of them belonging to the sameIndex.Group
. It should never be empty.- Specified by:
getIndexes
in interfaceIndex.QueryPlan
- Returns:
- the indexes selected by this query plan, which is never empty
-
getFirst
@Nonnull public Index getFirst()
Description copied from interface:Index.QueryPlan
Returns the first index in this plan.- Specified by:
getFirst
in interfaceIndex.QueryPlan
- Returns:
- the first index
-
getEstimatedResultRows
public long getEstimatedResultRows()
Description copied from interface:Index.QueryPlan
Return an estimate of the number of results this plan is expected to return for any givenReadCommand
that it can be used to answer. Used bySecondaryIndexManager.getBestIndexQueryPlanFor(RowFilter)
to determine theIndex.Group
with the most selective plan for a givenRowFilter
. Additionally, this is also used by StorageProxy.estimateResultsPerRange to calculate the initial concurrency factor for range requests- Specified by:
getEstimatedResultRows
in interfaceIndex.QueryPlan
- Returns:
- the estimated average number of results a Searcher may return for any given command
-
searcherFor
public Index.Searcher searcherFor(ReadCommand command)
Description copied from interface:Index.QueryPlan
Factory method for query time search helper.- Specified by:
searcherFor
in interfaceIndex.QueryPlan
- Parameters:
command
- the read command being executed- Returns:
- an Searcher with which to perform the supplied command
-
postIndexQueryFilter
public RowFilter postIndexQueryFilter()
Description copied from interface:Index.QueryPlan
Transform an initialRowFilter
into the filter that will still need to applied to a set of Rows after the index has performed it's initial scan. Used inReadCommand.executeLocally(ReadExecutionController)
to reduce the amount of filtering performed on the results of the index query.- Specified by:
postIndexQueryFilter
in interfaceIndex.QueryPlan
- Returns:
- the (hopefully) reduced filter that would still need to be applied after the index was used to narrow the initial result set
-
-