Package org.apache.calcite.plan
Interface RelOptListener
-
- All Superinterfaces:
java.util.EventListener
- All Known Implementing Classes:
MulticastRelOptListener
public interface RelOptListener extends java.util.EventListener
RelOptListener defines an interface for listening to events which occur during the optimization process.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
RelOptListener.RelChosenEvent
Event indicating that a relational expression has been chosen.static class
RelOptListener.RelDiscardedEvent
Event indicating that a relational expression has been discarded.static class
RelOptListener.RelEquivalenceEvent
Event indicating that a relational expression has been found to be equivalent to an equivalence class.static class
RelOptListener.RelEvent
Event class for abstract event dealing with a relational expression.static class
RelOptListener.RuleAttemptedEvent
Event indicating that a planner rule has been attemptedd.static class
RelOptListener.RuleEvent
Event indicating that a planner rule has fired.static class
RelOptListener.RuleProductionEvent
Event indicating that a planner rule has produced a result.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
relChosen(RelOptListener.RelChosenEvent event)
Notifies this listener that a relational expression has been chosen as part of the final implementation of the query plan.void
relDiscarded(RelOptListener.RelDiscardedEvent event)
Notifies this listener that a relational expression is no longer of interest to the planner.void
relEquivalenceFound(RelOptListener.RelEquivalenceEvent event)
Notifies this listener that a relational expression has been registered with a particular equivalence class after an equivalence has been either detected or asserted.void
ruleAttempted(RelOptListener.RuleAttemptedEvent event)
Notifies this listener that an optimizer rule is being applied to a particular relational expression.void
ruleProductionSucceeded(RelOptListener.RuleProductionEvent event)
Notifies this listener that an optimizer rule has been successfully applied to a particular relational expression, resulting in a new equivalent expression (relEquivalenceFound will also be called unless the new expression is identical to an existing one).
-
-
-
Method Detail
-
relEquivalenceFound
void relEquivalenceFound(RelOptListener.RelEquivalenceEvent event)
Notifies this listener that a relational expression has been registered with a particular equivalence class after an equivalence has been either detected or asserted. Equivalence classes may be either logical (all expressions which yield the same result set) or physical (all expressions which yield the same result set with a particular calling convention).- Parameters:
event
- details about the event
-
ruleAttempted
void ruleAttempted(RelOptListener.RuleAttemptedEvent event)
Notifies this listener that an optimizer rule is being applied to a particular relational expression. This rule is called twice; once before the rule is invoked, and once after. Note that the rel attribute of the event is always the old expression.- Parameters:
event
- details about the event
-
ruleProductionSucceeded
void ruleProductionSucceeded(RelOptListener.RuleProductionEvent event)
Notifies this listener that an optimizer rule has been successfully applied to a particular relational expression, resulting in a new equivalent expression (relEquivalenceFound will also be called unless the new expression is identical to an existing one). This rule is called twice; once before registration of the new rel, and once after. Note that the rel attribute of the event is always the new expression; to get the old expression, use event.getRuleCall().rels[0].- Parameters:
event
- details about the event
-
relDiscarded
void relDiscarded(RelOptListener.RelDiscardedEvent event)
Notifies this listener that a relational expression is no longer of interest to the planner.- Parameters:
event
- details about the event
-
relChosen
void relChosen(RelOptListener.RelChosenEvent event)
Notifies this listener that a relational expression has been chosen as part of the final implementation of the query plan. After the plan is copmlete, this is called one more time with null for the rel.- Parameters:
event
- details about the event
-
-