Package edu.brown.plannodes

Examples of edu.brown.plannodes.PlanNodeTreeWalker


        return (getReferencedColumnsForTree(catalog_db, node, new ListOrderedSet<Column>(), null, null));
    }

    private static Set<Column> getReferencedColumnsForTree(final Database catalog_db, final AbstractPlanNode node, final Set<Column> columns, final Set<Column> modified, final Set<Column> readOnly)
            throws Exception {
        new PlanNodeTreeWalker(true) {
            @Override
            protected void callback(final AbstractPlanNode node) {
                try {
                    CatalogUtil.getReferencedColumnsForPlanNode(catalog_db, node, columns, modified, readOnly);
                } catch (Exception ex) {
View Full Code Here


     * @return
     */
    public static Collection<Table> getReferencedTablesForTree(final Database catalog_db,
                                                               final AbstractPlanNode root) {
        final Set<Table> found = new ListOrderedSet<Table>();
        new PlanNodeTreeWalker(true) {
            @Override
            protected void callback(AbstractPlanNode element) {
                CatalogUtil.getReferencedTablesForPlanNode(catalog_db, element, found);
                return;
            }
View Full Code Here

     * @return
     */
    public static Collection<Index> getReferencedIndexesForTree(final Database catalog_db,
                                                                final AbstractPlanNode root) {
        final Set<Index> found = new ListOrderedSet<Index>();
        new PlanNodeTreeWalker(true) {
            @Override
            protected void callback(AbstractPlanNode element) {
                // IndexScanNode
                if (element instanceof IndexScanPlanNode) {
                    IndexScanPlanNode cast_node = (IndexScanPlanNode)element;
View Full Code Here

        final List<List<CatalogType>> materialize_elements = new ArrayList<List<CatalogType>>();

        // Find the MaterializePlanNode that feeds into the Insert
        // This will have the list of columns that will be used to insert into
        // the table
        new PlanNodeTreeWalker() {
            @Override
            protected void callback(final AbstractPlanNode node) {
                // We should find the Materialize node before the Insert
                if (node instanceof MaterializePlanNode) {
                    for (Integer column_guid : node.getOutputColumnGUIDs()) {
View Full Code Here

                                                 final AbstractPlanNode root_node,
                                                 final boolean convert_params,
                                                 final Collection<Table> tables) throws Exception {
        // Walk through the tree and figure out how the tables are being
        // referenced
        new PlanNodeTreeWalker() {
            {
                this.setAllowRevisit(true);
            }

            protected void populate_children(PlanNodeTreeWalker.Children<AbstractPlanNode> children, AbstractPlanNode node) {
View Full Code Here

     * @param rootNode
     */
    public static void populateTableNodeInfo(final PlanOptimizerState state, final AbstractPlanNode rootNode) {
        // Traverse tree and build up our data structures that maps all nodes to
        // the columns they affect
        new PlanNodeTreeWalker(true) {
            @Override
            protected void callback(AbstractPlanNode element) {
                try {
                    extractColumnInfo(state, element, this.getDepth() == 0);
                } catch (Exception ex) {
View Full Code Here

        final Set<String> join_tbls = new HashSet<String>();

        // Traverse from the bottom up and figure out what tables are referenced
        // in each AbstractJoinPlanNode
        for (AbstractPlanNode leaf : PlanNodeUtil.getLeafPlanNodes(rootNode)) {
            new PlanNodeTreeWalker(false, true) {
                @Override
                protected void callback(AbstractPlanNode element) {
                    // ---------------------------------------------------
                    // AbstractScanPlanNode
                    // ---------------------------------------------------
View Full Code Here

     * @param force
     * @return
     */
    public static boolean updateAllColumns(final PlanOptimizerState state, final AbstractPlanNode rootNode, final boolean force) {
        for (AbstractPlanNode leafNode : PlanNodeUtil.getLeafPlanNodes(rootNode)) {
            new PlanNodeTreeWalker(false, true) {
                @Override
                protected void callback(AbstractPlanNode element) {
                    if (trace.val)
                        LOG.trace("CURRENT:\n" + PlanNodeUtil.debugNode(element));

View Full Code Here

     * Correct any offsets in join nodes
     *
     * @param root
     */
    public static void fixJoinColumnOffsets(final PlanOptimizerState state, AbstractPlanNode root) {
        new PlanNodeTreeWalker(false) {
            @Override
            protected void callback(AbstractPlanNode element) {
                if (element instanceof NestLoopPlanNode || element instanceof NestLoopIndexPlanNode) {
                    // Make sure the column reference offsets of the output
                    // column are consecutive
View Full Code Here

        // Walk up the tree from the current node and figure out what columns
        // that we need from it are
        // referenced. This will tell us how many we can actually project out at
        // this point
        final Collection<Integer> col_guids = new ListOrderedSet<Integer>();
        new PlanNodeTreeWalker(true, true) {
            @Override
            protected void callback(AbstractPlanNode element) {
                // If this is the same node that we're examining, then we can
                // skip it
                // Otherwise, anything that this guy references but nobody else
View Full Code Here

TOP

Related Classes of edu.brown.plannodes.PlanNodeTreeWalker

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.