org.modeshape.graph.query.plan
Class PlanUtil
java.lang.Object
org.modeshape.graph.query.plan.PlanUtil
public class PlanUtil
- extends Object
Utilities for working with PlanNode
s.
Method Summary |
static PlanUtil.ColumnMapping |
createMappingFor(Schemata.View view,
PlanNode viewPlan)
|
static PlanUtil.ColumnMapping |
createMappingForAliased(SelectorName tableAlias,
Schemata.Table table,
PlanNode tableSourceNode)
|
static PlanUtil.ColumnMapping |
createMappingForAliased(SelectorName viewAlias,
Schemata.View view,
PlanNode viewPlan)
|
static List<Column> |
findRequiredColumns(QueryContext context,
PlanNode planNode)
Collected the minimum set of columns from the supplied table that are required by or used within the plan at the supplied
node or above. |
static Constraint |
replaceReferences(QueryContext context,
Constraint constraint,
PlanUtil.ColumnMapping mapping,
PlanNode node)
|
static Constraint |
replaceReferencesToRemovedSource(QueryContext context,
Constraint constraint,
Map<SelectorName,SelectorName> rewrittenSelectors)
|
static DynamicOperand |
replaceReferencesToRemovedSource(QueryContext context,
DynamicOperand operand,
Map<SelectorName,SelectorName> rewrittenSelectors)
|
static JoinCondition |
replaceReferencesToRemovedSource(QueryContext context,
JoinCondition joinCondition,
Map<SelectorName,SelectorName> rewrittenSelectors)
|
static void |
replaceReferencesToRemovedSource(QueryContext context,
PlanNode planNode,
Map<SelectorName,SelectorName> rewrittenSelectors)
|
static DynamicOperand |
replaceViewReferences(QueryContext context,
DynamicOperand operand,
PlanUtil.ColumnMapping mapping,
PlanNode node)
|
static JoinCondition |
replaceViewReferences(QueryContext context,
JoinCondition joinCondition,
PlanUtil.ColumnMapping mapping,
PlanNode node)
|
static void |
replaceViewReferences(QueryContext context,
PlanNode topOfViewInPlan,
PlanUtil.ColumnMapping mappings)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PlanUtil
public PlanUtil()
findRequiredColumns
public static List<Column> findRequiredColumns(QueryContext context,
PlanNode planNode)
- Collected the minimum set of columns from the supplied table that are required by or used within the plan at the supplied
node or above. This method first looks to see if the supplied node is a
PlanNode.Type.PROJECT
node, and if so immediately
returns that node's list of projected columns
. Otherwise, this method finds all of the
PlanNode.Type.SOURCE
nodes below the supplied plan node, and accumulates the set of sources for which the columns are to be
found. The method then walks up the plan, looking for references to columns of the supplied table, starting with the
supplied node and walking up until a PROJECT
node is found or the top of the plan is reached.
The resulting column list will always contain at the front the columns
from the nearest
PROJECT ancestor, followed by any columns required by criteria. This is done so that the processing of the nearest PROJECT
ancestor node can simply use the sublist of each tuple.
- Parameters:
context
- the query context; may not be nullplanNode
- the plan node at which the required columns need to be found; may not be null
- Returns:
- the list of
Column
objects that are used in the plan; never null but possibly empty if no columns are
actually needed
replaceReferencesToRemovedSource
public static void replaceReferencesToRemovedSource(QueryContext context,
PlanNode planNode,
Map<SelectorName,SelectorName> rewrittenSelectors)
replaceReferencesToRemovedSource
public static DynamicOperand replaceReferencesToRemovedSource(QueryContext context,
DynamicOperand operand,
Map<SelectorName,SelectorName> rewrittenSelectors)
replaceReferencesToRemovedSource
public static Constraint replaceReferencesToRemovedSource(QueryContext context,
Constraint constraint,
Map<SelectorName,SelectorName> rewrittenSelectors)
replaceReferencesToRemovedSource
public static JoinCondition replaceReferencesToRemovedSource(QueryContext context,
JoinCondition joinCondition,
Map<SelectorName,SelectorName> rewrittenSelectors)
replaceViewReferences
public static void replaceViewReferences(QueryContext context,
PlanNode topOfViewInPlan,
PlanUtil.ColumnMapping mappings)
replaceReferences
public static Constraint replaceReferences(QueryContext context,
Constraint constraint,
PlanUtil.ColumnMapping mapping,
PlanNode node)
replaceViewReferences
public static DynamicOperand replaceViewReferences(QueryContext context,
DynamicOperand operand,
PlanUtil.ColumnMapping mapping,
PlanNode node)
replaceViewReferences
public static JoinCondition replaceViewReferences(QueryContext context,
JoinCondition joinCondition,
PlanUtil.ColumnMapping mapping,
PlanNode node)
createMappingFor
public static PlanUtil.ColumnMapping createMappingFor(Schemata.View view,
PlanNode viewPlan)
createMappingForAliased
public static PlanUtil.ColumnMapping createMappingForAliased(SelectorName viewAlias,
Schemata.View view,
PlanNode viewPlan)
createMappingForAliased
public static PlanUtil.ColumnMapping createMappingForAliased(SelectorName tableAlias,
Schemata.Table table,
PlanNode tableSourceNode)
Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.