Class Compensation.ForMatch
- java.lang.Object
-
- com.apple.foundationdb.record.query.plan.temp.Compensation.ForMatch
-
- All Implemented Interfaces:
Compensation
,Compensation.WithPredicateCompensation
,Function<ExpressionRef<RelationalExpression>,RelationalExpression>
- Enclosing interface:
- Compensation
public static class Compensation.ForMatch extends Object implements Compensation.WithPredicateCompensation
Regular compensation class for matches based on query predicates.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.apple.foundationdb.record.query.plan.temp.Compensation
Compensation.ForMatch, Compensation.WithPredicateCompensation
-
-
Field Summary
-
Fields inherited from interface com.apple.foundationdb.record.query.plan.temp.Compensation
IMPOSSIBLE_COMPENSATION, NO_COMPENSATION
-
-
Constructor Summary
Constructors Constructor Description ForMatch(Compensation childCompensation, Map<QueryPredicate,QueryPredicate> predicateCompensationMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RelationalExpression
apply(ExpressionRef<RelationalExpression> reference)
When applied to a reference this method returns aLogicalFilterExpression
consuming the reference passed in that applies additional predicates as expressed by the predicate compensation map.Compensation.WithPredicateCompensation
derivedWithPredicateCompensationMap(Compensation childCompensation, IdentityHashMap<QueryPredicate,QueryPredicate> predicateCompensationMap)
Method to return a new compensation of at least typeCompensation.WithPredicateCompensation
based on the current compensation object.Compensation
getChildCompensation()
Map<QueryPredicate,QueryPredicate>
getPredicateCompensationMap()
-
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.Compensation
isNeeded
-
Methods inherited from interface com.apple.foundationdb.record.query.plan.temp.Compensation.WithPredicateCompensation
intersect, union
-
-
-
-
Constructor Detail
-
ForMatch
public ForMatch(@Nonnull Compensation childCompensation, @Nonnull Map<QueryPredicate,QueryPredicate> predicateCompensationMap)
-
-
Method Detail
-
getChildCompensation
@Nonnull public Compensation getChildCompensation()
- Specified by:
getChildCompensation
in interfaceCompensation.WithPredicateCompensation
-
getPredicateCompensationMap
@Nonnull public Map<QueryPredicate,QueryPredicate> getPredicateCompensationMap()
- Specified by:
getPredicateCompensationMap
in interfaceCompensation.WithPredicateCompensation
-
derivedWithPredicateCompensationMap
@Nonnull public Compensation.WithPredicateCompensation derivedWithPredicateCompensationMap(@Nonnull Compensation childCompensation, @Nonnull IdentityHashMap<QueryPredicate,QueryPredicate> predicateCompensationMap)
Description copied from interface:Compensation.WithPredicateCompensation
Method to return a new compensation of at least typeCompensation.WithPredicateCompensation
based on the current compensation object. This method should be implemented by implementing classes and/or their sub classes. TODO make this method protected in Java 11.- Specified by:
derivedWithPredicateCompensationMap
in interfaceCompensation.WithPredicateCompensation
- Parameters:
childCompensation
- a compensation that should be applied before the compensation being created in this methodpredicateCompensationMap
- map that mapsQueryPredicate
s of the query toQueryPredicate
s used for compensation- Returns:
- a new compensation
-
apply
public RelationalExpression apply(ExpressionRef<RelationalExpression> reference)
When applied to a reference this method returns aLogicalFilterExpression
consuming the reference passed in that applies additional predicates as expressed by the predicate compensation map.- Specified by:
apply
in interfaceFunction<ExpressionRef<RelationalExpression>,RelationalExpression>
- Parameters:
reference
- root of graph to apply compensation to- Returns:
- a new relational expression that corrects the result of
reference
by applying an additional filter
-
-