|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.relopt.AbstractRelOptPlanner org.eigenbase.test.MockRelOptPlanner
public class MockRelOptPlanner
MockRelOptPlanner is a mock implementation of the RelOptPlanner
interface.
Nested Class Summary | |
---|---|
private class |
MockRelOptPlanner.MockRuleCall
|
Field Summary | |
---|---|
private RelNode |
root
|
private RelOptRule |
rule
|
private RelNode |
transformationResult
|
Fields inherited from interface org.eigenbase.relopt.RelOptPlanner |
---|
tracer |
Constructor Summary | |
---|---|
MockRelOptPlanner()
|
Method Summary | |
---|---|
boolean |
addRule(RelOptRule rule)
Registers a rule. |
RelNode |
changeTraits(RelNode rel,
RelTraitSet toTraits)
Changes a relational expression to an equivalent one with a different set of traits. |
RelNode |
ensureRegistered(RelNode rel,
RelNode equivRel)
Registers a relational expression if it is not already registered. |
RelNode |
findBestExp()
Finds the most efficient expression to implement this query. |
RelNode |
getRoot()
Returns the root node of this query. |
boolean |
isRegistered(RelNode rel)
Determines whether a relational expression has been registered. |
private boolean |
match(RelOptRuleOperand operand,
RelNode rel,
List<RelNode> bindings)
Matches a relational expression to a rule. |
private boolean |
matchRecursive(RelNode rel,
RelNode parent,
int ordinalInParent)
Recursively matches a rule. |
RelNode |
register(RelNode rel,
RelNode equivRel)
Registers a relational expression in the expression bank. |
boolean |
removeRule(RelOptRule rule)
Removes a rule. |
void |
setRoot(RelNode rel)
Sets the root node of this query. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private RelNode root
private RelOptRule rule
private RelNode transformationResult
Constructor Detail |
---|
public MockRelOptPlanner()
Method Detail |
---|
public void setRoot(RelNode rel)
RelOptPlanner
rel
- Relational expressionpublic RelNode getRoot()
RelOptPlanner
public boolean addRule(RelOptRule rule)
RelOptPlanner
ConverterRule
and pass the ConverterRule to
all registered
RelTraitDef
instances.
Collection.add(E)
public boolean removeRule(RelOptRule rule)
RelOptPlanner
Collection.remove(Object)
public RelNode changeTraits(RelNode rel, RelTraitSet toTraits)
RelOptPlanner
rel
- Relational expression, may or may not have been registeredtoTraits
- Trait set to convert relational expression to
public RelNode findBestExp()
RelOptPlanner
private boolean matchRecursive(RelNode rel, RelNode parent, int ordinalInParent)
rel
- Relational expressionparent
- Parent relational expressionordinalInParent
- Ordinal of relational expression among its
siblings
private boolean match(RelOptRuleOperand operand, RelNode rel, List<RelNode> bindings)
operand
- Root operand of rulerel
- Relational expressionbindings
- Bindings, populated on successful match
public RelNode register(RelNode rel, RelNode equivRel)
RelOptPlanner
After it has been registered, you may not modify it.
The expression must not already have been registered. If you are not
sure whether it has been registered, call RelOptPlanner.ensureRegistered(RelNode,RelNode)
.
rel
- Relational expression to register (must not already be
registered)equivRel
- Relational expression it is equivalent to (may be null)
public RelNode ensureRegistered(RelNode rel, RelNode equivRel)
RelOptPlanner
rel
- Relational expression to registerequivRel
- Relational expression it is equivalent to (may be null)
public boolean isRegistered(RelNode rel)
RelOptPlanner
rel
- expression to test
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |