@API(value=EXPERIMENTAL) public class CascadesRuleCall extends Object implements PlannerRuleCall
CascadesPlanner
. This rule call implements the logic for handling new
expressions as they are generated by a PlannerRule.onMatch(PlannerRuleCall)
and passed to the rule call
via the yield(ExpressionRef)
method, which consists primarily of manipulating the implicit a memo data
structure defined by GroupExpressionRef
s and PlannerExpression
s.Constructor and Description |
---|
CascadesRuleCall(PlanContext context,
PlannerRule<? extends PlannerExpression> rule,
GroupExpressionRef<PlannerExpression> root,
PlannerBindings bindings) |
Modifier and Type | Method and Description |
---|---|
PlannerBindings |
getBindings()
Return the map of bindings that this rule's matcher expression produced, which includes (by contract) all of the
bindings specified by the rule associated with this call.
|
PlanContext |
getContext()
Get the planning context with metadata that might be relevant to the planner, such as the list of available
indexes.
|
<U extends PlannerExpression> |
ref(U expression)
Wrap the given planner expression in an implementation of
ExpressionRef suitable for the planner associated
with this rule. |
void |
run() |
void |
yield(ExpressionRef<? extends PlannerExpression> expression)
Notify the planner's data structures that the new expression contained in
expression has been
produced by the rule. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get
public CascadesRuleCall(@Nonnull PlanContext context, @Nonnull PlannerRule<? extends PlannerExpression> rule, @Nonnull GroupExpressionRef<PlannerExpression> root, @Nonnull PlannerBindings bindings)
public void run()
@Nonnull public PlannerBindings getBindings()
PlannerRuleCall
PlannerRuleCall.get(ExpressionMatcher)
.getBindings
in interface PlannerRuleCall
@Nonnull public PlanContext getContext()
PlannerRuleCall
getContext
in interface PlannerRuleCall
PlanContext
object with various metadata that could affect planningpublic void yield(@Nonnull ExpressionRef<? extends PlannerExpression> expression)
PlannerRuleCall
expression
has been
produced by the rule. This method may be called zero or more times by the rule's onMatch()
method.yield
in interface PlannerRuleCall
expression
- the expression produced by the rulepublic <U extends PlannerExpression> ExpressionRef<U> ref(U expression)
PlannerRuleCall
ExpressionRef
suitable for the planner associated
with this rule. Different rule call implementations might use different reference types depending on the specifics
of the associated planner.ref
in interface PlannerRuleCall
U
- the type of the planner expressionexpression
- the planner expression to wrap in a reference typeexpression
wrapped in a reference