org.objectweb.medor.optim.rdb
Class GroupSameDBRule

java.lang.Object
  extended byorg.objectweb.medor.optim.lib.BasicRule
      extended byorg.objectweb.medor.optim.rdb.GroupSameDBRule
All Implemented Interfaces:
RewriteRule

public class GroupSameDBRule
extends BasicRule
implements RewriteRule

This class groups together as a single RbdExpQueryLeaf the RdbQueryLeaves working on the same data store. TODO: Known limitation : This rule does not reorganize a QueryTree Another rule should be developed to put close together leaves working on the same data store.


Nested Class Summary
protected static class GroupSameDBRule.RdbQuery
          The RdbQuery class represents the result of rewriting a QueryTree.
protected static class GroupSameDBRule.SplitQueries
          This class represents the result of splitting the children of a given QueryTree qt in presence of MemberOf operators in qt's query filter.
 
Nested classes inherited from class org.objectweb.medor.optim.lib.BasicRule
BasicRule.ModifiedExpression
 
Field Summary
 
Fields inherited from class org.objectweb.medor.optim.lib.BasicRule
debug, log
 
Constructor Summary
GroupSameDBRule()
           
 
Method Summary
protected  GroupSameDBRule.SplitQueries recurseSplit(GroupSameDBRule.SplitQueries split, Expression e)
          Performs the actual work of splitting a QueryTree starting from its expression.
 QueryTree rewrite(QueryTree qt, QueryNode parent)
          Implementation of the RewriteRule interface.
 
Methods inherited from class org.objectweb.medor.optim.lib.BasicRule
replaceUsage, rewrite
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.medor.optim.api.RewriteRule
rewrite
 

Constructor Detail

GroupSameDBRule

public GroupSameDBRule()
Method Detail

rewrite

public QueryTree rewrite(QueryTree qt,
                         QueryNode parent)
                  throws MedorException
Implementation of the RewriteRule interface.

It groups together the RdbQueryLeaves if they are on the same data store.

Specified by:
rewrite in interface RewriteRule
Parameters:
qt - the QueryTree to be rewritten by this rule.
parent - the parent QueryNode for which modification of propagated field, if they are replaced in the qt, should be done.
Returns:
the rewritten QueryTree
Throws:
MedorException - if all RdbQueryLeaves are not on the same data store.
See Also:
RewriteRule

recurseSplit

protected GroupSameDBRule.SplitQueries recurseSplit(GroupSameDBRule.SplitQueries split,
                                                    Expression e)
Performs the actual work of splitting a QueryTree starting from its expression.

Parameters:
split - the input SplitQueries object
e - the Expression from which to build the SplitQueries
Returns:
the SplitQueries object constructed from the Expression
See Also:
GroupSameDBRule.SplitQueries