org.eigenbase.relopt
Class MulticastRelOptListener

java.lang.Object
  extended by org.eigenbase.relopt.MulticastRelOptListener
All Implemented Interfaces:
EventListener, RelOptListener

public class MulticastRelOptListener
extends Object
implements RelOptListener

MulticastRelOptListener implements the RelOptListener interface by forwarding events on to a collection of other listeners.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/relopt/MulticastRelOptListener.java#6 $
Author:
John V. Sichi

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eigenbase.relopt.RelOptListener
RelOptListener.RelChosenEvent, RelOptListener.RelDiscardedEvent, RelOptListener.RelEquivalenceEvent, RelOptListener.RelEvent, RelOptListener.RuleAttemptedEvent, RelOptListener.RuleEvent, RelOptListener.RuleProductionEvent
 
Field Summary
private  List<RelOptListener> listeners
           
 
Constructor Summary
MulticastRelOptListener()
          Creates a new empty multicast listener.
 
Method Summary
 void addListener(RelOptListener listener)
          Adds a listener which will receive multicast events.
 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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

private final List<RelOptListener> listeners
Constructor Detail

MulticastRelOptListener

public MulticastRelOptListener()
Creates a new empty multicast listener.

Method Detail

addListener

public void addListener(RelOptListener listener)
Adds a listener which will receive multicast events.

Parameters:
listener - listener to add

relEquivalenceFound

public void relEquivalenceFound(RelOptListener.RelEquivalenceEvent event)
Description copied from interface: RelOptListener
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).

Specified by:
relEquivalenceFound in interface RelOptListener
Parameters:
event - details about the event

ruleAttempted

public void ruleAttempted(RelOptListener.RuleAttemptedEvent event)
Description copied from interface: RelOptListener
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.

Specified by:
ruleAttempted in interface RelOptListener
Parameters:
event - details about the event

ruleProductionSucceeded

public void ruleProductionSucceeded(RelOptListener.RuleProductionEvent event)
Description copied from interface: RelOptListener
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].

Specified by:
ruleProductionSucceeded in interface RelOptListener
Parameters:
event - details about the event

relChosen

public void relChosen(RelOptListener.RelChosenEvent event)
Description copied from interface: RelOptListener
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.

Specified by:
relChosen in interface RelOptListener
Parameters:
event - details about the event

relDiscarded

public void relDiscarded(RelOptListener.RelDiscardedEvent event)
Description copied from interface: RelOptListener
Notifies this listener that a relational expression is no longer of interest to the planner.

Specified by:
relDiscarded in interface RelOptListener
Parameters:
event - details about the event