Package org.voltdb.plannodes

Examples of org.voltdb.plannodes.AbstractPlanNode


            // Then make sure that we update it's output columns to match the
            // inline output
            node.getOutputColumnGUIDs().clear();
            node.getOutputColumnGUIDs().addAll(proj_node.getOutputColumnGUIDs());
        } else {
            AbstractPlanNode parent = node.getParent(0);
            assert (parent != null);
            node.clearParents();
            parent.clearChildren();
            proj_node.addAndLinkChild(node);
            parent.addAndLinkChild(proj_node);
        }

        // Mark the new ProjectionPlanNode as dirty
        state.markDirty(proj_node);
        state.markDirty(node);
View Full Code Here


                LOG.debug("Examining " + join_node);

            // Check whether the chain below this node is
            // RECIEVE -> SEND -> SCAN
            assert (join_node.getChildPlanNodeCount() >= 1);
            AbstractPlanNode child = join_node.getChild(0);
            if (debug.val)
                LOG.debug(join_node + " -> " + child);
            if (child instanceof ReceivePlanNode) {
                ReceivePlanNode recv_node = (ReceivePlanNode) child;
                SendPlanNode send_node = (SendPlanNode) child.getChild(0);
                List<AbstractPlanNode> children = send_node.getChildren();
                assert (children != null);
                if (children.size() > 1)
                    continue;
                if (children.get(0).getChildPlanNodeCount() > 0)
                    continue;
                if ((children.get(0) instanceof AbstractScanPlanNode) == false)
                    continue;

                AbstractPlanNode leaf_node = children.get(0);
                assert (leaf_node instanceof AbstractScanPlanNode);
                Collection<Table> leaf_tables = CatalogUtil.getReferencedTablesForPlanNode(state.catalog_db, leaf_node);
                assert (leaf_tables.size() == 1);
                Table leaf_tbl = CollectionUtil.first(leaf_tables);

                Collection<Table> join_tables = CatalogUtil.getReferencedTablesForPlanNode(state.catalog_db, join_node);
                Table join_tbl = null;
                for (Table catalog_tbl : join_tables) {
                    if (catalog_tbl.equals(leaf_tbl) == false) {
                        join_tbl = catalog_tbl;
                        break;
                    }
                } // FOR
                assert (join_tbl != null);

                // If either table is replicated, then the leaf scan should be linked
                // directly with the Join PlanNode
                if (join_tbl.getIsreplicated() || leaf_tbl.getIsreplicated()) {
                    AbstractPlanNode parent = join_node.getParent(0);
                    assert (parent != null);
                    parent.clearChildren();
                    parent.addAndLinkChild(recv_node);
                    state.markDirty(parent);
                    state.markDirty(recv_node);

                    join_node.clearParents();
                    join_node.clearChildren();
                    leaf_node.clearParents();

                    join_node.addAndLinkChild(leaf_node);
                    state.markDirty(join_node);
                    state.markDirty(leaf_node);

                    // HACK: If the parent is a ProjectionPlanNode, then we'll want
                    // to duplicate it so that we make sure that our original
                    // SEND/RECIEVE nodes have the right offsets
                    if (parent instanceof ProjectionPlanNode) {
                        AbstractPlanNode parent_clone = null;
                        try {
                            parent_clone = (AbstractPlanNode) parent.clone(false, false);
                        } catch (CloneNotSupportedException ex) {
                            throw new RuntimeException(ex);
                        }
                        assert (parent_clone != null);
                        assert (parent != parent_clone);
                        parent_clone.addAndLinkChild(join_node);
                        send_node.clearChildren();
                        send_node.addAndLinkChild(parent_clone);
                    } else {
                        send_node.clearChildren();
                        send_node.addAndLinkChild(join_node);
View Full Code Here

                        assert (element.getChildPlanNodeCount() == 1) : "Projection element expected 1 child but has " + element.getChildPlanNodeCount() + " children";
                        new_root = element.getChild(0);
                        if (debug.val)
                            LOG.debug("PLANOPT - Promoted " + new_root + " as the new query plan root!");
                    } else {
                        AbstractPlanNode parent = element.getParent(0);
                        assert(parent != null);
                        for (AbstractPlanNode child : element.getChildren()) {
                            parent.addAndLinkChild(child);
                        } // FOR
                    }

                    // Off with it's head!
                    if (debug.val)
View Full Code Here

        }
        // PLANFRAGMENT
        else if (catalog_obj instanceof PlanFragment) {
            PlanFragment catalog_frgmt = (PlanFragment)catalog_obj;
            try {
                AbstractPlanNode node = PlanNodeUtil.getPlanNodeTreeForPlanFragment(catalog_frgmt);
                sb.append(StringUtil.SINGLE_LINE);
                sb.append(PlanNodeUtil.debug(node));
            } catch (Exception e) {
                e.printStackTrace();
            }
View Full Code Here

        } // FOR
       
        if (catalog_obj instanceof Statement) {
            Statement catalog_stmt = (Statement)catalog_obj;
            try {
                AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, false);
                for (Integer guid : PlanNodeUtil.getAllPlanColumnGuids(root)) {
                    if (this.plannode_node_xref.containsKey(guid) == false) {
                        this.plannode_node_xref.put(guid, new HashSet<DefaultMutableTreeNode>());
                    }
                    this.plannode_node_xref.get(guid).add(node);
View Full Code Here

                        if (is_singlepartition && !statement_cat.getHas_singlesited()) continue;
                        if (!is_singlepartition && !statement_cat.getHas_multisited()) continue;

                        String label = (is_singlepartition ? "Single-Partition" : "Distributed") + " Plan Fragments";
//                            String attributes = "";
                        AbstractPlanNode node = null;
                       
                        try {
                            node = PlanNodeUtil.getRootPlanNodeForStatement(statement_cat, is_singlepartition);
                        } catch (Exception e) {
                            String msg = e.getMessage();
View Full Code Here

                assert(this.nodes_frags[node_idx] != -1);
                node_idx++;
            } // FOR
           
            for (int frag_idx = 0; frag_idx < this.fragments.length; frag_idx++) {
                AbstractPlanNode max = null;
                int max_depth = -1;
               
                AbstractPlanNode min = null;
                int min_depth = Integer.MAX_VALUE;
               
                for (node_idx = 0; node_idx < nodes.length; node_idx++) {
                    if (this.nodes_frags[node_idx] != frag_idx) continue;
                    int depth = PlanNodeUtil.getDepth(this.nodes[node_idx]);
View Full Code Here

            for (int frag_idx = 0; frag_idx < this.fragments.length; frag_idx++) {
                g2.setColor(frag_idx == 0 ? Color.BLUE : Color.BLACK);
//                System.err.println(this.fragment_boundaries[frag_idx] + " => " + this.nodes_frags[frag_idx]);
               
                Pair<AbstractPlanNode, AbstractPlanNode> p = this.fragment_boundaries[frag_idx];
                AbstractPlanNode topNode = p.getFirst();
                Point2D topPos = visualizationPanel.getPosition(topNode);
//                System.err.println(topNode + " -> " + topPos);
                AbstractPlanNode botNode = p.getSecond();
                Point2D botPos = visualizationPanel.getPosition(botNode);
//                System.err.println(botNode + " -> " + botPos);
               
                if (nodeSize == null) {
                    Shape s = visualizationPanel.getRenderContext().getVertexShapeTransformer().transform(topNode);
View Full Code Here

    public void testProjectionPushdownDistinctOffset() throws Exception {
        Procedure catalog_proc = this.getProcedure(slev.class);
        Statement catalog_stmt = this.getStatement(catalog_proc, "GetStockCount");
       
        // Grab the root node of the multi-partition query plan tree for this Statement
        AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, true);
        assertNotNull(root);
       
        // Make sure that the DistinctPlanNode's target column is OL_I_ID
        Collection<DistinctPlanNode> dist_nodes = PlanNodeUtil.getPlanNodes(root, DistinctPlanNode.class);
        assertEquals(1, dist_nodes.size());
View Full Code Here

    public void testProjectionPushdown() throws Exception {
        Procedure catalog_proc = this.getProcedure(neworder.class);
        Statement catalog_stmt = this.getStatement(catalog_proc, "getCustomer");
       
        // Grab the root node of the multi-partition query plan tree for this Statement
        AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, false);
        assertNotNull(root);
       
        // First check that our single scan node has an inline Projection
        Collection<AbstractScanPlanNode> scan_nodes = PlanNodeUtil.getPlanNodes(root, AbstractScanPlanNode.class);
        assertEquals(1, scan_nodes.size());
View Full Code Here

TOP

Related Classes of org.voltdb.plannodes.AbstractPlanNode

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.