use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.
the class PrioritizedRuleController method rewriteWithRuleCollection.
@Override
public boolean rewriteWithRuleCollection(Mutable<ILogicalOperator> root, Collection<IAlgebraicRewriteRule> rules) throws AlgebricksException {
boolean anyRuleFired = false;
boolean anyChange = false;
do {
anyChange = false;
for (IAlgebraicRewriteRule r : rules) {
while (true) {
boolean ruleFired = rewriteOperatorRef(root, r);
if (ruleFired) {
anyChange = true;
anyRuleFired = true;
} else {
// go to next rule
break;
}
}
}
} while (anyChange);
return anyRuleFired;
}
Aggregations