public class RuleMatchVisualizer extends Object implements RelOptListener
// create the visualizer
RuleMatchVisualizer viz = new RuleMatchVisualizer("/path/to/output/dir", "file-name-suffix");
viz.attachTo(planner)
planner.findBestExpr();
// extra step for HepPlanner: write the output to files
// a VolcanoPlanner will call it automatically
viz.writeToFile();
RelOptListener.RelChosenEvent, RelOptListener.RelDiscardedEvent, RelOptListener.RelEquivalenceEvent, RelOptListener.RelEvent, RelOptListener.RuleAttemptedEvent, RelOptListener.RuleEvent, RelOptListener.RuleProductionEvent| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_SET |
| Constructor and Description |
|---|
RuleMatchVisualizer()
Use this constructor when the result shall not be written to disk.
|
RuleMatchVisualizer(String outputDirectory,
String outputSuffix)
Use this constructor to save the result on disk at the end of the planning
phase.
|
| Modifier and Type | Method and Description |
|---|---|
void |
attachTo(RelOptPlanner planner)
Attaches the visualizer to the planner.
|
String |
getJsonStringResult() |
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).
|
void |
setIncludeIntermediateCosts(boolean includeIntermediateCosts)
Output intermediate costs, including all cost updates.
|
void |
setIncludeTransitiveEdges(boolean includeTransitiveEdges)
Output edges from a subset to the nodes of all subsets that satisfy it.
|
void |
writeToFile()
Writes the HTML and JS files of the rule match visualization.
|
public static final String DEFAULT_SET
public RuleMatchVisualizer(String outputDirectory, String outputSuffix)
Note: when using HepPlanner, writeToFile() needs to be called
manually.
public RuleMatchVisualizer()
public void attachTo(RelOptPlanner planner)
public void setIncludeTransitiveEdges(boolean includeTransitiveEdges)
public void setIncludeIntermediateCosts(boolean includeIntermediateCosts)
public void ruleAttempted(RelOptListener.RuleAttemptedEvent event)
RelOptListenerruleAttempted in interface RelOptListenerevent - details about the eventpublic void relChosen(RelOptListener.RelChosenEvent event)
RelOptListenerrelChosen in interface RelOptListenerevent - details about the eventpublic void ruleProductionSucceeded(RelOptListener.RuleProductionEvent event)
RelOptListenerruleProductionSucceeded in interface RelOptListenerevent - details about the eventpublic void relDiscarded(RelOptListener.RelDiscardedEvent event)
RelOptListenerrelDiscarded in interface RelOptListenerevent - details about the eventpublic void relEquivalenceFound(RelOptListener.RelEquivalenceEvent event)
RelOptListenerrelEquivalenceFound in interface RelOptListenerevent - details about the eventpublic String getJsonStringResult()
public void writeToFile()
The old files with the same name will be replaced.
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.