|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.relopt.AbstractRelOptPlanner
public abstract class AbstractRelOptPlanner
AbstractRelOptPlanner is an abstract base for implementations of the RelOptPlanner
interface.
Field Summary | |
---|---|
private CancelFlag |
cancelFlag
|
private static Pattern |
IntegerPattern
Regular expression for integer. |
private MulticastRelOptListener |
listener
|
private Map<String,RelOptRule> |
mapDescToRule
Maps rule description to rule, just to ensure that rules' descriptions are unique. |
private Pattern |
ruleDescExclusionFilter
|
Fields inherited from interface org.eigenbase.relopt.RelOptPlanner |
---|
tracer |
Constructor Summary | |
---|---|
protected |
AbstractRelOptPlanner()
Creates an AbstractRelOptPlanner. |
Method Summary | |
---|---|
void |
addListener(RelOptListener newListener)
Adds a listener to this planner. |
boolean |
addRelTraitDef(RelTraitDef relTraitDef)
Registers a rel trait definition. |
void |
checkCancel()
Checks to see whether cancellation has been requested, and if so, throws an exception. |
RelOptPlanner |
chooseDelegate()
Negotiates an appropriate planner to deal with distributed queries. |
protected void |
fireRule(RelOptRuleCall ruleCall)
Fires a rule, taking care of tracing and listener notification. |
RelOptCost |
getCost(RelNode rel)
Computes the cost of a RelNode. |
JavaRelImplementor |
getJavaRelImplementor(RelNode rel)
Retrieves an implementor appropriate for the context in which this planner was created. |
protected MulticastRelOptListener |
getListener()
|
long |
getRelMetadataTimestamp(RelNode rel)
Gets a timestamp for a given rel's metadata. |
protected RelOptRule |
getRuleByDescription(String description)
Returns the rule with a given description |
boolean |
isRuleExcluded(RelOptRule rule)
Determines whether a given rule is excluded by ruleDescExclusionFilter. |
RelOptCost |
makeCost(double dRows,
double dCpu,
double dIo)
Creates a cost object. |
RelOptCost |
makeHugeCost()
Creates a cost object representing an enormous non-infinite cost. |
RelOptCost |
makeInfiniteCost()
Creates a cost object representing infinite cost. |
RelOptCost |
makeTinyCost()
Creates a cost object representing a small positive cost. |
RelOptCost |
makeZeroCost()
Creates a cost object representing zero cost. |
protected void |
mapRuleDescription(RelOptRule rule)
Registers a rule's description. |
protected void |
notifyChosen(RelNode rel)
Takes care of tracing and listener notification when a rel is chosen as part of the final plan. |
protected void |
notifyDiscard(RelNode rel)
Takes care of tracing and listener notification when a rel is discarded |
protected void |
notifyEquivalence(RelNode rel,
Object equivalenceClass,
boolean physical)
Takes care of tracing and listener notification when a rel equivalence is detected. |
protected void |
notifyTransformation(RelOptRuleCall ruleCall,
RelNode newRel,
boolean before)
Takes care of tracing and listener notification when a rule's transformation is applied. |
void |
registerMetadataProviders(ChainedRelMetadataProvider chain)
Gives this planner a chance to register one or more RelMetadataProvider s in the chain which will be used to answer metadata
queries. |
void |
registerSchema(RelOptSchema schema)
Tells this planner that a schema exists. |
void |
setCancelFlag(CancelFlag cancelFlag)
Installs the cancellation-checking flag for this planner. |
void |
setImportance(RelNode rel,
double importance)
Sets the importance of a relational expression. |
void |
setRuleDescExclusionFilter(Pattern exclusionFilter)
Sets the exclusion filter to use for this planner. |
protected void |
unmapRuleDescription(RelOptRule rule)
Removes the mapping between a rule and its description. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eigenbase.relopt.RelOptPlanner |
---|
addRule, changeTraits, ensureRegistered, findBestExp, getRoot, isRegistered, register, removeRule, setRoot |
Field Detail |
---|
private static final Pattern IntegerPattern
private final Map<String,RelOptRule> mapDescToRule
private MulticastRelOptListener listener
private Pattern ruleDescExclusionFilter
private CancelFlag cancelFlag
Constructor Detail |
---|
protected AbstractRelOptPlanner()
Method Detail |
---|
public void setCancelFlag(CancelFlag cancelFlag)
RelOptPlanner
setCancelFlag
in interface RelOptPlanner
cancelFlag
- flag which the planner should periodically checkpublic void checkCancel()
protected void mapRuleDescription(RelOptRule rule)
rule
- Ruleprotected void unmapRuleDescription(RelOptRule rule)
rule
- Ruleprotected RelOptRule getRuleByDescription(String description)
description
- Description
public void setRuleDescExclusionFilter(Pattern exclusionFilter)
RelOptPlanner
setRuleDescExclusionFilter
in interface RelOptPlanner
exclusionFilter
- pattern to match for exclusion; null to disable
filteringpublic boolean isRuleExcluded(RelOptRule rule)
rule
- rule to test
public RelOptPlanner chooseDelegate()
RelOptPlanner
chooseDelegate
in interface RelOptPlanner
public void registerSchema(RelOptSchema schema)
RelOptPlanner
registerSchema
in interface RelOptPlanner
public long getRelMetadataTimestamp(RelNode rel)
RelOptPlanner
CachingRelMetadataProvider
to decide whether cached metadata has
gone stale.
getRelMetadataTimestamp
in interface RelOptPlanner
rel
- rel of interest
public void setImportance(RelNode rel, double importance)
RelOptPlanner
An important use of this method is when a RelOptRule
has
created a relational expression which is indisputably better than the
original relational expression. The rule set the original relational
expression's importance to zero, to reduce the search space. Pending rule
calls are cancelled, and future rules will not fire.
setImportance
in interface RelOptPlanner
rel
- Relational expressionimportance
- Importancepublic RelOptCost makeCost(double dRows, double dCpu, double dIo)
RelOptPlanner
makeCost
in interface RelOptPlanner
public RelOptCost makeHugeCost()
RelOptPlanner
makeHugeCost
in interface RelOptPlanner
public RelOptCost makeInfiniteCost()
RelOptPlanner
makeInfiniteCost
in interface RelOptPlanner
public RelOptCost makeTinyCost()
RelOptPlanner
makeTinyCost
in interface RelOptPlanner
public RelOptCost makeZeroCost()
RelOptPlanner
makeZeroCost
in interface RelOptPlanner
public RelOptCost getCost(RelNode rel)
RelOptPlanner
RelMetadataQuery.getCumulativeCost(org.eigenbase.rel.RelNode)
.
getCost
in interface RelOptPlanner
rel
- expression of interest
public void addListener(RelOptListener newListener)
RelOptPlanner
addListener
in interface RelOptPlanner
newListener
- new listener to be notified of eventspublic JavaRelImplementor getJavaRelImplementor(RelNode rel)
RelOptPlanner
getJavaRelImplementor
in interface RelOptPlanner
public void registerMetadataProviders(ChainedRelMetadataProvider chain)
RelOptPlanner
RelMetadataProvider
s in the chain which will be used to answer metadata
queries. Planners which use their own relational expressions internally
to represent concepts such as equivalence classes will generally need to
supply corresponding metadata providers.
registerMetadataProviders
in interface RelOptPlanner
chain
- receives planner's custom providers, if anypublic boolean addRelTraitDef(RelTraitDef relTraitDef)
RelOptPlanner
RelTraitDef
has already
been registered, does nothing.
addRelTraitDef
in interface RelOptPlanner
Collection.add(E)
protected void fireRule(RelOptRuleCall ruleCall)
ruleCall
- description of rule callprotected void notifyTransformation(RelOptRuleCall ruleCall, RelNode newRel, boolean before)
ruleCall
- description of rule callnewRel
- result of transformationbefore
- true before registration of new rel; false afterprotected void notifyChosen(RelNode rel)
rel
- chosen relprotected void notifyEquivalence(RelNode rel, Object equivalenceClass, boolean physical)
rel
- chosen relprotected void notifyDiscard(RelNode rel)
rel
- discarded relprotected MulticastRelOptListener getListener()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |