com.metamatrix.query.optimizer.relational
Class RelationalPlanner

java.lang.Object
  extended by com.metamatrix.query.optimizer.relational.RelationalPlanner
All Implemented Interfaces:
CommandPlanner

public class RelationalPlanner
extends java.lang.Object
implements CommandPlanner

This class generates a relational plan for query execution. The output of this class is a PlanNode object - this object then becomes the input to PlanToProcessConverter to produce a metamatrix.query.processor.relational.RelationalPlan RelationalPlan.


Field Summary
static java.lang.Integer HINTS
          Key for a PlanHints object
static java.lang.Integer VARIABLE_CONTEXTS
           
 
Constructor Summary
RelationalPlanner()
           
 
Method Summary
static RuleStack buildRules(PlanHints hints)
           
 void generateCanonical(CommandTreeNode node, QueryMetadataInterface metadata, AnalysisRecord analysisRecord, CommandContext context)
          Requests that the planner generate the canonical plan(s) for the Command object(s) represented by the CommandTreeNode tree parameter.
 ProcessorPlan optimize(CommandTreeNode node, IDGenerator idGenerator, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, AnalysisRecord analysisRecord, CommandContext context)
          Allows the planner a chance to optimize the canonical plan(s) stored in the CommandTreeNode tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HINTS

public static final java.lang.Integer HINTS
Key for a PlanHints object


VARIABLE_CONTEXTS

public static final java.lang.Integer VARIABLE_CONTEXTS
Constructor Detail

RelationalPlanner

public RelationalPlanner()
Method Detail

generateCanonical

public void generateCanonical(CommandTreeNode node,
                              QueryMetadataInterface metadata,
                              AnalysisRecord analysisRecord,
                              CommandContext context)
                       throws QueryPlannerException,
                              QueryMetadataException,
                              MetaMatrixComponentException
Description copied from interface: CommandPlanner

Requests that the planner generate the canonical plan(s) for the Command object(s) represented by the CommandTreeNode tree parameter. The canonical plan(s) should be added to the node(s) of the tree rooted at rootNode.

It may or may not make sense for a specific implementation of this Class to create a canonical plan. It may be that all planning can be done during the call to CommandPlanner.optimize(com.metamatrix.query.optimizer.CommandTreeNode, com.metamatrix.core.id.IDGenerator, com.metamatrix.query.metadata.QueryMetadataInterface, com.metamatrix.query.optimizer.capabilities.CapabilitiesFinder, com.metamatrix.query.analysis.AnalysisRecord, com.metamatrix.query.util.CommandContext)

Specified by:
generateCanonical in interface CommandPlanner
Parameters:
node - tree of CommandTreeNode object(s) rooted at rootNode
Throws:
QueryPlannerException - indicating a problem in planning
MetaMatrixComponentException - indicating an unexpected exception
QueryMetadataException
See Also:
com.metamatrix.query.optimizer.CommandPlanner#generateCanonical(com.metamatrix.query.optimizer.CommandTreeNode, boolean)

optimize

public ProcessorPlan optimize(CommandTreeNode node,
                              IDGenerator idGenerator,
                              QueryMetadataInterface metadata,
                              CapabilitiesFinder capFinder,
                              AnalysisRecord analysisRecord,
                              CommandContext context)
                       throws QueryPlannerException,
                              QueryMetadataException,
                              MetaMatrixComponentException
Description copied from interface: CommandPlanner
Allows the planner a chance to optimize the canonical plan(s) stored in the CommandTreeNode tree. This method should be called in a bottom-up manner; from leaf nodes up to the root node.

Specified by:
optimize in interface CommandPlanner
Parameters:
node - root of a tree (or subtree) of CommandTreeNode objects, each of which should have its canonical plan
metadata - source of metadata
capFinder - Class usable to find the connector capabilities for a particular model
Returns:
ProcessorPlan implementation specific to the CommandPlanner
Throws:
QueryPlannerException - indicating a problem in planning
QueryMetadataException - indicating an exception in accessing the metadata
MetaMatrixComponentException - indicating an unexpected exception
See Also:
com.metamatrix.query.optimizer.CommandPlanner#optimize(com.metamatrix.query.optimizer.CommandTreeNode, java.util.Map, com.metamatrix.query.metadata.QueryMetadataInterface, boolean)

buildRules

public static RuleStack buildRules(PlanHints hints)


Copyright © 2009. All Rights Reserved.