Class PrimaryScanMatchCandidate
- java.lang.Object
-
- com.apple.foundationdb.record.query.plan.temp.PrimaryScanMatchCandidate
-
- All Implemented Interfaces:
MatchCandidate
public class PrimaryScanMatchCandidate extends Object implements MatchCandidate
Case class to represent a match candidate that is backed by an index.
-
-
Constructor Summary
Constructors Constructor Description PrimaryScanMatchCandidate(ExpressionRefTraversal traversal, List<CorrelationIdentifier> parameters, Set<String> availableRecordTypes, Set<String> queriedRecordTypes, KeyExpression alternativeKeyExpression)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KeyExpression
getAlternativeKeyExpression()
This method returns a key expression that can be used to actually compute the the keys of this candidate for a given record.Set<String>
getAvailableRecordTypes()
String
getName()
Returns the name of the match candidate.List<CorrelationIdentifier>
getParameters()
Returns the parameter names for all necessary parameters that need to be bound during matching.Set<String>
getQueriedRecordTypes()
ExpressionRefTraversal
getTraversal()
Returns the traversal object for this candidate.RelationalExpression
toScanExpression(List<ComparisonRange> comparisonRanges, boolean isReverse)
Creates a logical expression that represents a scan over the materialized candidate data.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.apple.foundationdb.record.query.plan.temp.MatchCandidate
computeBoundParameterPrefixMap, findReferencingExpressions, toScanExpression
-
-
-
-
Constructor Detail
-
PrimaryScanMatchCandidate
public PrimaryScanMatchCandidate(@Nonnull ExpressionRefTraversal traversal, @Nonnull List<CorrelationIdentifier> parameters, @Nonnull Set<String> availableRecordTypes, @Nonnull Set<String> queriedRecordTypes, @Nonnull KeyExpression alternativeKeyExpression)
-
-
Method Detail
-
getName
@Nonnull public String getName()
Description copied from interface:MatchCandidate
Returns the name of the match candidate. If this candidate represents and index, it will be the name of the index.- Specified by:
getName
in interfaceMatchCandidate
- Returns:
- the name of this match candidate
-
getTraversal
@Nonnull public ExpressionRefTraversal getTraversal()
Description copied from interface:MatchCandidate
Returns the traversal object for this candidate. The traversal object can either be computed up-front when the candidate is created or lazily when this method is invoked. It is, however, necessary that the traversal once computed is stable, meaning the object returned by implementors of this method must always return the same object.- Specified by:
getTraversal
in interfaceMatchCandidate
- Returns:
- the traversal associated for this match candidate
-
getParameters
@Nonnull public List<CorrelationIdentifier> getParameters()
Description copied from interface:MatchCandidate
Returns the parameter names for all necessary parameters that need to be bound during matching.- Specified by:
getParameters
in interfaceMatchCandidate
- Returns:
- a list of
CorrelationIdentifier
s for all the used parameters in this match candidate
-
getAlternativeKeyExpression
@Nonnull public KeyExpression getAlternativeKeyExpression()
Description copied from interface:MatchCandidate
This method returns a key expression that can be used to actually compute the the keys of this candidate for a given record. The current expression hierarchy cannot be evaluated at runtime (in general). This key expression helps representing compensation or part of compensation if needed.- Specified by:
getAlternativeKeyExpression
in interfaceMatchCandidate
- Returns:
- a key expression that can be evaluated based on a base record
-
toScanExpression
@Nonnull public RelationalExpression toScanExpression(@Nonnull List<ComparisonRange> comparisonRanges, boolean isReverse)
Description copied from interface:MatchCandidate
Creates a logical expression that represents a scan over the materialized candidate data. This method is expected to be implemented by specific implementations ofMatchCandidate
.- Specified by:
toScanExpression
in interfaceMatchCandidate
- Parameters:
comparisonRanges
- aList
ofComparisonRange
s to be appliedisReverse
- an indicator whether this expression should conceptually flow data in an ascending (forward) or descending (backward or reverse) order- Returns:
- a new
RelationalExpression
-
-