org.modeshape.jcr.query.optimize
Class RuleBasedOptimizer
java.lang.Object
org.modeshape.jcr.query.optimize.RuleBasedOptimizer
- All Implemented Interfaces:
- Optimizer
@Immutable
public class RuleBasedOptimizer
- extends Object
- implements Optimizer
Optimizer implementation that optimizes a query using a stack of rules. Subclasses can override the
populateRuleStack(LinkedList, PlanHints)
method to define the stack of rules they'd like to use, including the use of
custom rules.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RuleBasedOptimizer
public RuleBasedOptimizer()
optimize
public PlanNode optimize(QueryContext context,
PlanNode plan)
- Description copied from interface:
Optimizer
- Optimize the supplied query plan and produce an executable processor plan.
- Specified by:
optimize
in interface Optimizer
- Parameters:
context
- the context in which the query is being optimizedplan
- the query plan to be optimized
- Returns:
- the optimized query plan; never null
populateRuleStack
protected void populateRuleStack(LinkedList<OptimizerRule> ruleStack,
PlanHints hints)
- Method that is used to create the initial rule stack. This method can be overridden by subclasses
- Parameters:
ruleStack
- the stack where the rules should be placed; never nullhints
- the plan hints
Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.