|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.wpi.cs.dsrg.xmldb.xat.common.visitorpattern.InheritableVisitor | +--edu.wpi.cs.dsrg.xmldb.xat.common.visitorpattern.TwoParamVisitor | +--edu.wpi.cs.dsrg.xmldb.xat.component.xatrewrite.ReWriteRules | +--edu.wpi.cs.dsrg.xmldb.xat.component.xatrewrite.ComputationPushdownRules
This Class is used to push down operators by traversing the XAT.
Fields inherited from class edu.wpi.cs.dsrg.xmldb.xat.component.xatrewrite.ReWriteRules |
classVector,
result,
statis,
variableTable |
Constructor Summary | |
ComputationPushdownRules()
Default ComputationPushdownRules constructor. |
Method Summary | |
protected void |
cleanSchema(XATNode root)
Clean all the schema of XAT with a given root. |
protected boolean |
deleteRedundantRename(NameColumn ncOp)
Delete redundent Rename operator This method compares the old column name and new column, if they are equal or both of them are null, then return true, else return false. |
protected void |
findMatchingPatternNode(DOMPatternNode root,
NavigationStep[] toMatch,
java.util.Vector toFill)
Find the nodes matching the give NavigationSteps. |
protected void |
nameColumnSubTree(XATOperator child,
java.lang.String oldColumn,
java.lang.String newColumn)
Change all attached sub tree output column names. |
protected void |
renameExpression(BinExpression exp,
java.lang.String newName,
java.lang.String toMatch)
The Method recursively looks at the left and right sides of an Expression. |
protected void |
renameTagger(DOMPatternNode root,
java.lang.String toMatch,
java.lang.String newName)
This method recursively look at the DOM Tree, traverses through the DOMPattern tree, which has a DOMPatternNoe as root, until it finds all TagNode and ColumnNameNode. |
java.lang.Object |
visit(Aggregate parent,
XATOperator child)
Rules for removing a useless Aggregation operator. |
java.lang.Object |
visit(NameColumn parent,
Aggregate child)
Rules for pushing a NameColumn operator through an Aggregate operator. |
java.lang.Object |
visit(NameColumn parent,
CartesianProduct child)
Rules for pushing a NameColumn node through a generic XATOperator |
java.lang.Object |
visit(NameColumn parent,
Function child)
Rules for pushing a NameColumn operator through a Function operator. |
java.lang.Object |
visit(NameColumn parent,
GroupBy child)
Rules for pushing a NameColumn node through a GroupBy |
java.lang.Object |
visit(NameColumn parent,
Navigate child)
Rules for pushing a NameColumn node through a Navigate Node. |
java.lang.Object |
visit(NameColumn parent,
Select child)
Rules for pushing a NameColumn operator through a Select operator. |
java.lang.Object |
visit(NameColumn parent,
Source child)
Rules for pushing a NameColumn node through a Source Node. |
java.lang.Object |
visit(NameColumn parent,
Tagger child)
Rules for pushing a NameColumn operator through a Tagger operator. |
java.lang.Object |
visit(NameColumn parent,
XATMultiSourceOperator child)
Rules for pushing a NameColumn node through a generic XATOperator. |
java.lang.Object |
visit(Navigate parent,
CartesianProduct child)
Rules for pushing a Navigate node through a XATMultiSourceOperator . |
java.lang.Object |
visit(Navigate parent,
GroupBy child)
Rules for pushing a Navigate operator through a Groupby operator A Navigate can, but for the sake of order sensitive rewrite, is never pushed through a groupby (due to the way the tree is generated, this would normally only allow a navunnest of a text() to be pushed anyway). |
java.lang.Object |
visit(Navigate parent,
NameColumn child)
Rules for pushing a Navigate operator through a NameColumn operator A Navigate node can always be pushed through a NameColumn operartor This rule is the same as NameColumn / Navigate |
java.lang.Object |
visit(Navigate parent,
Navigate child)
Rules for pushing a Navigate operator through a Navigate operator. |
java.lang.Object |
visit(Navigate parent,
Project child)
Rules for pushing a Navigate operator through a Project operator A Navigate can always move through a Project, but the destination of the Navigate node must be added to columns that are Projected |
java.lang.Object |
visit(Navigate parent,
Select child)
Rules for pushing a Navigate operator through a Select operator A Navigate can always move through a Select |
java.lang.Object |
visit(Navigate parent,
Source child)
Rules for pushing a Navigate operator through a Source operator A Navigate can never go through a Source operator. |
java.lang.Object |
visit(Navigate parent,
XATMultiSourceOperator child)
Rules for pushing a Navigate node through a XATMultiSourceOperator . |
java.lang.Object |
visit(Navigate parent,
XATOperator child)
Rules for pushing a Navigate operator through a generic XATOperator operator A Navigate can always be pushed through a Distinct |
java.lang.Object |
visit(Select parent,
CartesianProduct child)
Select MultipleSource Operator Product Rule. |
java.lang.Object |
visit(Select parent,
GroupBy child)
Select GroupBy Rule. |
java.lang.Object |
visit(Select parent,
Navigate child)
Select Navigate Rule. |
java.lang.Object |
visit(Select parent,
XATMultiSourceOperator child)
Select MultipleSource Operator Product Rule. |
java.lang.Object |
visit(Select parent,
XATOperator child)
Select XATOperator Rule. |
java.lang.Object |
visit(Tagger parent,
XATOperator child)
Rules for removing a useless Tagger operator |
Methods inherited from class edu.wpi.cs.dsrg.xmldb.xat.component.xatrewrite.ReWriteRules |
combineSteps,
copyNode,
createString,
deleteAggregate,
deletePartialTagger,
deleteWholeTagger,
dispatch,
dispatch,
dispatch,
evaluateRules,
evaluateRules,
findMatchingNavigationNode,
findMatchingNavigationNode,
getChildren,
getColumnNames,
getStatis,
getVariableTable,
isDebug,
isGatherStatistics,
isUsedAbove,
moveNode,
moveNodeToRoot,
setDebug,
setVariableTable,
swap,
visit,
visit |
Methods inherited from class edu.wpi.cs.dsrg.xmldb.xat.common.visitorpattern.TwoParamVisitor |
getMethod,
visit |
Methods inherited from class edu.wpi.cs.dsrg.xmldb.xat.common.visitorpattern.InheritableVisitor |
getAncestors,
getMethod,
visit |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ComputationPushdownRules()
Method Detail |
protected void cleanSchema(XATNode root)
root
- edu.wpi.cs.dsrg.xmldb.xat.common.xatnode.XATNodeXATTree
,
XATNode
protected boolean deleteRedundantRename(NameColumn ncOp)
ncOp
- edu.wpi.cs.dsrg.xmldb.xat.common.operator.specialoperator.NameColumnNameColumn
protected void findMatchingPatternNode(DOMPatternNode root, NavigationStep[] toMatch, java.util.Vector toFill)
root
- The root of the DOMPatternNode.toMatch
- The NavigationStep used as match pattern.toFill
- All the matches found.DOMPattern
,
DOMPatternNode
,
ColumnNameNodeImp
,
AttributeNodeImp
,
TagNodeImp
,
TextNodeImp
protected void nameColumnSubTree(XATOperator child, java.lang.String oldColumn, java.lang.String newColumn)
The
- XATTree attached to a GroupBy node (GroupBy, Function, Aggregate).oldColumn
- The name of old column.newColumn
- The name of new column.GroupBy
,
XATOperator
,
XATTree.
protected void renameExpression(BinExpression exp, java.lang.String newName, java.lang.String toMatch)
exp
- The expression going to be searched.toMatch
- The name of the column being searched.newName
- The new column name.BinExpression
,
TerminalExpression
,
ColumnNameNodeImp
protected void renameTagger(DOMPatternNode root, java.lang.String toMatch, java.lang.String newName)
root
- The root node of DOM pattern tree.newName
- The new column name.toMatch
- The name of the column being searhed.DOMPattern
,
DOMPatternNode
,
ColumnNameNodeImp
,
TagNodeImp
public java.lang.Object visit(NameColumn parent, Function child)
parent
- parent XAT operator (NameColumn).child
- child XAT Operator (Function).NameColumn
,
Function
,
ReWriteResult
public java.lang.Object visit(NameColumn parent, Source child)
parent
- parent XAT operator (NameColumn).child
- child XAT Operator (Source).NameColumn
,
Source
,
ReWriteResult
public java.lang.Object visit(NameColumn parent, CartesianProduct child)
parent
- parent XAT operator (NameColumn).child
- child XAT Operator (CartesianProduct).NameColumn
,
CartesianProduct
,
ReWriteResult
,
renameExpression
,
deleteRedundantRename
public java.lang.Object visit(NameColumn parent, GroupBy child)
parent
- parent XAT operator (NameColumn).child
- child XAT Operator (XATOperator).NameColumn
,
Function
,
ReWriteResult
,
nameColumnSubTree
public java.lang.Object visit(NameColumn parent, Select child)
parent
- parent XAT operator (NameColumn).child
- child XAT Operator (Select).NameColumn
,
Select
,
ReWriteResult
,
renameExpression
public java.lang.Object visit(NameColumn parent, XATMultiSourceOperator child)
parent
- parent XAT operator (NameColumn).child
- child XAT Operator (XATMultiSourceOperator).NameColumn
,
XATMultiSourceOperator
,
ReWriteResult
,
deleteRedundantRename
public java.lang.Object visit(NameColumn parent, Aggregate child)
parent
- parent XAT operator (NameColumn).child
- child XAT Operator (Aggregate).NameColumn
,
Aggregate
,
ReWriteResult
public java.lang.Object visit(NameColumn parent, Navigate child)
parent
- parent XAT operator (NameColumn).child
- child XAT Operator (Navigate).NameColumn
,
Function
,
ReWriteResult
,
deleteRedundantRename
public java.lang.Object visit(NameColumn parent, Tagger child)
parent
- parent XAT operator (NameColumn).child
- child XAT Operator (Tagger).NameColumn
,
Tagger
,
ReWriteResult
public java.lang.Object visit(Select parent, CartesianProduct child)
Select MultipleSource Operator Product Rule. we want to determine what to do with the Select, there are 4 possiblities. 1) The Select should move to the left branch 2) The Select should move to the right branch 3) The Select should be merged with the Cartesian to form an OuterJoin 4) The Select should stay on top of the Cartesian to determine which case we have, we will try to findMatchingNavigateNode on both the left and right branches of the Cartesian with both the left and right column names of the select to accomplish this, we will use a state machine two booleans, left and right are set to true. if any column name does not go to that side, then the boolean is set to false after all column names have been checked against all branches, we can determine which of the 4 actions to take 1) true / false 2) false / true 3) true / true 4) false / false
parent
- parent XAT operator (Select).child
- child XAT Operator (CartesianProduct).Select
,
CartesianProduct
,
ReWriteResult
,
findMatchingNavigationNode
,
moveNode
public java.lang.Object visit(Select parent, GroupBy child)
parent
- parent XAT operator (Select).child
- child XAT Operator (GroupBy).Select
,
GroupBy
,
ReWriteResult
public java.lang.Object visit(Select parent, XATMultiSourceOperator child)
Select MultipleSource Operator Product Rule. MultipleSource are operators exclude CartesianProduct family operators. For example: Merge, Set operator, IF_THEN_ELSE operator, "Or" operator. In this case, no push down will be applied. For the semantic will be changed.
parent
- parent XAT operator (Select).child
- child XAT Operator (XATMultiSourceOperator).Select
,
XATMultiSourceOperator
,
ReWriteResult
public java.lang.Object visit(Select parent, XATOperator child)
parent
- parent XAT operator (Select).child
- child XAT Operator (XATOperator).Select
,
XATOperator
,
ReWriteResult
public java.lang.Object visit(Select parent, Navigate child)
parent
- parent XAT operator (Select).child
- child XAT Operator (Navigate).Select
,
Navigate
,
ReWriteResult
public java.lang.Object visit(Aggregate parent, XATOperator child)
parent
- parent XAT operator (Aggregate).child
- child XAT Operator.XATOperator
,
ReWriteResult
public java.lang.Object visit(Navigate parent, NameColumn child)
parent
- parent XAT operator (Navigate).child
- child XAT Operator (NameColumn).Navigate
,
GroupBy
,
ReWriteResult
,
deleteRedundantRename
public java.lang.Object visit(Navigate parent, Source child)
parent
- parent XAT operator (Navigate).child
- child XAT Operator (Source).Navigate
,
Source
,
ReWriteResult
public java.lang.Object visit(Navigate parent, CartesianProduct child)
Rules for pushing a Navigate node through a XATMultiSourceOperator . This is also the same rule for Navigate The XATMultiSourceOperator node will have n branches, the Navigate node must be moved to the branch that contains a Navigate node whose destination equals parent.entryPoint findMatchingNavigationNode is used to determine which branch to move to This rules apply to cartesian product operators.
parent
- parent XAT operator (NameColumn).child
- child XAT Operator (XATMultiSourceOperator).Navigate
,
XATMultiSourceOperator
,
ReWriteResult
public java.lang.Object visit(Navigate parent, GroupBy child)
parent
- parent XAT operator (Navigate).child
- child XAT Operator (GroupBy).Navigate
,
GroupBy
,
ReWriteResult
public java.lang.Object visit(Navigate parent, Project child)
parent
- parent XAT operator (Navigate).child
- child XAT Operator (Project).Navigate
,
Project
,
ReWriteResult
public java.lang.Object visit(Navigate parent, Select child)
parent
- parent XAT operator (Navigate).child
- child XAT Operator (Select).Navigate
,
Select
,
ReWriteResult
public java.lang.Object visit(Navigate parent, XATMultiSourceOperator child)
Rules for pushing a Navigate node through a XATMultiSourceOperator . MultipleSource are operators exclude CartesianProduct family operators. For example: Merge, Set operator, IF_THEN_ELSE operator, "Or" operator. In this case, no push down will be applied. For the semantic will be changed.
parent
- parent XAT operator (Navigate).child
- child XAT Operator (XATMultiSourceOperator).Navigate
,
XATMultiSourceOperator
,
ReWriteResult
public java.lang.Object visit(Navigate parent, XATOperator child)
parent
- parent XAT operator (Navigate).child
- child XAT Operator (XATOperator).Navigate
,
XATOperator
,
ReWriteResult
public java.lang.Object visit(Navigate parent, Navigate child)
parent
- parent XAT operator (Navigate).child
- child XAT Operator (Navigate).Navigate
,
Navigate
,
ReWriteResult
public java.lang.Object visit(Tagger parent, XATOperator child)
parent
- parent XAT operator (Tagger).child
- child XAT Operator (XATOperator).Tagger
,
XATOperator
,
ReWriteResult
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |