Class StorageAttachedIndexQueryPlan
- java.lang.Object
-
- org.apache.cassandra.index.sai.plan.StorageAttachedIndexQueryPlan
-
- All Implemented Interfaces:
java.lang.Comparable<Index.QueryPlan>
,Index.QueryPlan
public class StorageAttachedIndexQueryPlan extends java.lang.Object implements Index.QueryPlan
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
UNSUPPORTED_NON_STRICT_OPERATOR
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StorageAttachedIndexQueryPlan
create(ColumnFamilyStore cfs, TableQueryMetrics queryMetrics, java.util.Set<StorageAttachedIndex> indexes, RowFilter filter)
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.java.util.Set<Index>
getIndexes()
Returns the indexes selected by this query plan, all of them belonging to the sameIndex.Group
.boolean
isTopK()
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.java.util.function.Function<PartitionIterator,PartitionIterator>
postProcessor(ReadCommand command)
Called on coordinator after merging replica responses before returning to clientIndex.Searcher
searcherFor(ReadCommand command)
Factory method for query time search helper.boolean
shouldEstimateInitialConcurrency()
Used to determine whether to estimate initial concurrency during remote range reads.-
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, getFirst, supportsReplicaFilteringProtection, validate
-
-
-
-
Field Detail
-
UNSUPPORTED_NON_STRICT_OPERATOR
public static final java.lang.String UNSUPPORTED_NON_STRICT_OPERATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
@Nullable public static StorageAttachedIndexQueryPlan create(ColumnFamilyStore cfs, TableQueryMetrics queryMetrics, java.util.Set<StorageAttachedIndex> indexes, RowFilter filter)
-
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
-
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
-
shouldEstimateInitialConcurrency
public boolean shouldEstimateInitialConcurrency()
Description copied from interface:Index.QueryPlan
Used to determine whether to estimate initial concurrency during remote range reads. Default is true, each implementation must override this method if they choose a different strategy.- Specified by:
shouldEstimateInitialConcurrency
in interfaceIndex.QueryPlan
- Returns:
- true if the
Index.QueryPlan
should estimate initial concurrency, false otherwise
-
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
-
postProcessor
public java.util.function.Function<PartitionIterator,PartitionIterator> postProcessor(ReadCommand command)
Called on coordinator after merging replica responses before returning to client- Specified by:
postProcessor
in interfaceIndex.QueryPlan
- Parameters:
command
- the read command being executed
-
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:
- a filter with all the expressions that are user-defined or for a non-indexed partition key column
(currently index on partition columns is not supported, see
StorageAttachedIndex.validateOptions(Map, TableMetadata)
)
-
isTopK
public boolean isTopK()
- Specified by:
isTopK
in interfaceIndex.QueryPlan
- Returns:
- true if given index query plan is a top-k request
-
-