Package com.apple.foundationdb.record.query.plan.temp.matchers
Classes related to the Cascades matcher system and its implementation.
The Cascades
planner is based on a system of rules, each of which is
defined by a matcher expression and a method that is applied when an expression matches a given matcher expression.
A matcher is represented by an implementation of the ExpressionMatcher
interface and is responsible for inspecting the structure of a planner expression, determining
whether it matches an expression, and providing bindings to access particular substructures of the expression during
the execution of the rule. These bindings are exposed by the PlannerBindings
class.
-
Interface Summary Interface Description ExpressionChildrenMatcher AnExpressionChildrenMatcher
describes how to match the children of aRelationalExpression
(i.e., the references returned by theRelationalExpression.getQuantifiers()
method).ExpressionMatcher<T extends Bindable> AExpressionMatcher
is an expression that can be matched against aRelationalExpression
tree, while binding certain expressions/references in the tree to expression matcher objects. -
Class Summary Class Description AllChildrenMatcher An expression children matcher that tries to match all children to a singleExpressionMatcher
.AnyChildMatcher An expression children matcher that tries to match any child to the givenExpressionMatcher
, producing a stream of bindings that is the concatenation of the (possibly empty) streams of bindings from attempting to match each child to the given matcher.AnyChildrenMatcher A children matcher that matches any set of children.AnyChildWithRestMatcher An expression matcher that tries to match any child to the givenExpressionMatcher
while providing aReferenceMatcher
binding to all other children.ListChildrenMatcher A matcher for a children that tries to match each child to a specified matcher.PlannerBindings A map-like structure that supports a map from a binding to a collection ofBindable
s, such asRelationalExpression
s andExpressionRef
s.PlannerBindings.Builder A mutable builder for a set ofPlannerBindings
which can be used to incrementally build up a set of bindings without repeatedly callingPlannerBindings.mergedWith(PlannerBindings)
, which is less efficient.QuantifierMatcher<T extends Quantifier> Matches a subclass ofQuantifier
and a given matcher against the children.ReferenceMatcher<T extends RelationalExpression> An expression matcher that matches against any reference at all.TypeMatcher<T extends Bindable> A matcher that is specified by the class of its expression: to match any of several types of expressions, they must all implement a common interface (which itself extendsPlannerExpression
).TypeWithPredicateMatcher<T extends RelationalExpressionWithPredicate> Matches a subclass ofRelationalExpressionWithPredicate
with a given predicate (as determined byRelationalExpressionWithPredicate.getPredicate()
and a given matcher against the children.