/** * Return only the {@link ServiceNode} child nodes in this group. */ public List<ServiceNode> getServiceNodes() { return getChildren(ServiceNode.class); }
/** * Return only the filter child nodes in this group. */ public List<FilterNode> getAllFiltersInGroup() { return getChildren(FilterNode.class); }
/** * Return only the statement pattern child nodes in this group. */ public List<StatementPatternNode> getStatementPatterns() { return getChildren(StatementPatternNode.class); }
/** * Return any <code>LET x:= expr</code> or <code>(expr AS ?x)</code> nodes * in <i>this</i> group (these are modeled in exactly the same way by the * AST {@link AssignmentNode}). * <p> * Note: {@link AssignmentNode}s MUST NOT be reordered. They MUST be * evaluated left-to-right in the order given in the original query. */ public List<AssignmentNode> getAssignments(){ return getChildren(AssignmentNode.class); }
/** * Return only the {@link NamedSubqueryInclude} child nodes in this group. */ public List<NamedSubqueryInclude> getNamedSubqueryIncludes() { return getChildren(NamedSubqueryInclude.class); }
/** * Return only the filter child nodes in this group. */ public List<FilterNode> getAllFiltersInGroup() { return getChildren(FilterNode.class); }
/** * Return only the {@link ServiceNode} child nodes in this group. */ public List<ServiceNode> getServiceNodes() { return getChildren(ServiceNode.class); }
/** * Return only the {@link NamedSubqueryInclude} child nodes in this group. */ public List<NamedSubqueryInclude> getNamedSubqueryIncludes() { return getChildren(NamedSubqueryInclude.class); }
/** * Return only the statement pattern child nodes in this group. */ public List<StatementPatternNode> getStatementPatterns() { return getChildren(StatementPatternNode.class); }
/** * Return any <code>LET x:= expr</code> or <code>(expr AS ?x)</code> nodes * in <i>this</i> group (these are modeled in exactly the same way by the * AST {@link AssignmentNode}). * <p> * Note: {@link AssignmentNode}s MUST NOT be reordered. They MUST be * evaluated left-to-right in the order given in the original query. */ public List<AssignmentNode> getAssignments(){ return getChildren(AssignmentNode.class); }
/** * Optimize the join group. */ protected void optimizeJoinGroup(final AST2BOpContext ctx, final StaticAnalysis sa, final IBindingSet[] bSets, final JoinGroupNode group) { for (PropertyPathNode node : group.getChildren(PropertyPathNode.class)) { optimize(ctx, sa, group, node, null); } }
@Override public Set<IVariable<?>> getDesiredBound(StaticAnalysis sa) { final Set<IVariable<?>> desiredBound = new HashSet<IVariable<?>>(); for (IGroupMemberNode child : getChildren()) { desiredBound.addAll(child.getDesiredBound(sa)); } return desiredBound; } }
/** * Optimize the join group. */ protected void optimizeJoinGroup(final AST2BOpContext ctx, final StaticAnalysis sa, final IBindingSet[] bSets, final JoinGroupNode group) { for (PropertyPathNode node : group.getChildren(PropertyPathNode.class)) { optimize(ctx, sa, group, node, null); } }
/** * Optimize the join group. */ protected void optimizeJoinGroup(final AST2BOpContext ctx, final StaticAnalysis sa, final IBindingSet[] bSets, final JoinGroupNode group) { // final long start = System.currentTimeMillis(); for (FilterNode node : group.getChildren(FilterNode.class)) { optimize(ctx, sa, group, node); } // time += (System.currentTimeMillis() - start); // System.err.println(time); }
@Override public Set<IVariable<?>> getRequiredBound(StaticAnalysis sa) { final Set<IVariable<?>> requiredBound = new HashSet<IVariable<?>>(); for (IGroupMemberNode child : getChildren()) { requiredBound.addAll(child.getRequiredBound(sa)); } return requiredBound; }
@Override public Set<IVariable<?>> getDesiredBound(StaticAnalysis sa) { final Set<IVariable<?>> desiredBound = new HashSet<IVariable<?>>(); for (IGroupMemberNode child : getChildren()) { desiredBound.addAll(child.getDesiredBound(sa)); } return desiredBound; } }
@Override public Set<IVariable<?>> getRequiredBound(StaticAnalysis sa) { final Set<IVariable<?>> requiredBound = new HashSet<IVariable<?>>(); for (IGroupMemberNode child : getChildren()) { requiredBound.addAll(child.getRequiredBound(sa)); } return requiredBound; }
/** * Optimize the join group. */ protected void optimizeJoinGroup(final AST2BOpContext ctx, final StaticAnalysis sa, final IBindingSet[] bSets, final JoinGroupNode group) { // final long start = System.currentTimeMillis(); for (FilterNode node : group.getChildren(FilterNode.class)) { optimize(ctx, sa, group, node); } // time += (System.currentTimeMillis() - start); // System.err.println(time); }
public List<IReorderableNode> getReorderableChildren() { final List<IReorderableNode> nodes = getChildren(IReorderableNode.class); final Iterator<IReorderableNode> it = nodes.iterator(); while (it.hasNext()) { final IReorderableNode node = it.next(); if (ASTStaticJoinOptimizer.log.isDebugEnabled()) { ASTStaticJoinOptimizer.log.debug(node); ASTStaticJoinOptimizer.log.debug(node.isReorderable()); } if (!node.isReorderable()) { it.remove(); } } return nodes; }
public List<IReorderableNode> getReorderableChildren() { final List<IReorderableNode> nodes = getChildren(IReorderableNode.class); final Iterator<IReorderableNode> it = nodes.iterator(); while (it.hasNext()) { final IReorderableNode node = it.next(); if (ASTStaticJoinOptimizer.log.isDebugEnabled()) { ASTStaticJoinOptimizer.log.debug(node); ASTStaticJoinOptimizer.log.debug(node.isReorderable()); } if (!node.isReorderable()) { it.remove(); } } return nodes; }