Package edu.brown.designer

Examples of edu.brown.designer.DesignerEdge


                LOG.trace("Vertex0: " + vertex0.getCatalogKey());
                LOG.trace("Vertex1: " + vertex0.getCatalogKey());
                LOG.trace("ColumnSet:\n" + cset.debug() + "\n");
            }

            DesignerEdge edge = this.addEdge(agraph, AccessType.PARAM_JOIN, cset, vertex0, vertex1);
            if (!this.multi_stmt_edge_xref.containsKey(edge)) {
                this.multi_stmt_edge_xref.put(edge, new HashSet<Set<Statement>>());
            }
            Set<Statement> new_set = new HashSet<Statement>();
            new_set.add(catalog_stmt0);
View Full Code Here


            stmts_debug += "]";
        }

        // We need to first check whether we already have an edge representing
        // this ColumnSet
        DesignerEdge new_edge = null;
        for (DesignerEdge edge : agraph.getEdges()) {
            Collection<DesignerVertex> vertices = agraph.getIncidentVertices(edge);
            PredicatePairs other_cset = (PredicatePairs) edge.getAttribute(EdgeAttributes.COLUMNSET.name());
            if (vertices.contains(v0) && vertices.contains(v1) && cset.equals(other_cset)) {
                if (t)
                    LOG.trace("FOUND DUPLICATE COLUMN SET: " + other_cset.debug() + "\n" + cset.toString() + "\n[" + edge.hashCode() + "] + " + cset.size() + " == " + other_cset.size() + "\n");
                new_edge = edge;
                break;
            }
        } // FOR
        if (new_edge == null) {
            new_edge = new DesignerEdge(agraph);
            new_edge.setAttribute(EdgeAttributes.ACCESSTYPE.name(), access_type);
            new_edge.setAttribute(EdgeAttributes.COLUMNSET.name(), cset);
            agraph.addEdge(new_edge, v0, v1, EdgeType.UNDIRECTED);
            if (d)
                LOG.debug("New " + access_type + " edge for " + stmts_debug + " between " + v0 + "<->" + v1 + ": " + cset.debug());
        }
        // For edges created by implicitly for joins, we're not going to have a
View Full Code Here

                if (other_vertex == null) {
                    throw new Exception("ERROR: The constraint '" + catalog_const + "' on '" + vertex + "' uses an unknown table '" + catalog_fkey_table.getName() + "'");
                }
                PredicatePairs cset = new PredicatePairs();
                // FIXME cset.add(catalog_const.getFkeycolumn, catalog_col);
                DesignerEdge edge = new DesignerEdge(graph);
                edge.setAttribute(DependencyGraph.EdgeAttributes.CONSTRAINT.name(), catalog_const);
                edge.setAttribute(DependencyGraph.EdgeAttributes.COLUMNSET.name(), cset);
                graph.addEdge(edge, other_vertex, vertex, EdgeType.DIRECTED);
            } // FOR
        } // FOR
    }
View Full Code Here

         *
         * @param child_table
         * @return
         */
        public DesignerEdge getEdge(Table child_table) {
            DesignerEdge ret = null;
            if (this.table_edge_xref.containsKey(child_table)) {
                ret = CollectionUtil.first(this.table_edge_xref.get(child_table));
            }
            return (ret);
        }
View Full Code Here

            Table catalog_tbl = e.getKey();
            TableProfile profile = e.getValue();
            DesignerVertex v = dgraph.getVertex(catalog_tbl);

            for (Table other_tbl : profile.getDependentTables()) {
                boolean ret = dgraph.addEdge(new DesignerEdge(dgraph), dgraph.getVertex(other_tbl), v, EdgeType.DIRECTED);
                assert (ret) : "Failed to add edge from " + other_tbl + " to " + catalog_tbl;
            } // FOR
        } // FOR
        return (dgraph);
    }
View Full Code Here

            LOG.debug("v0: " + v0 + "\n");
            for (int ctr1 = ctr0 + 1; ctr1 < cnt; ctr1++) {
                DesignerVertex v1 = ptree_vertices.get(ctr1);
                LOG.debug("  |- v1: " + v1 + "\n");
                DesignerEdge ag_edge = this.agraph.findEdge(v0, v1);

                if (((v0.getCatalogItem().getName().equals("WAREHOUSE") && v1.getCatalogItem().getName().equals("STOCK")) || (v1.getCatalogItem().getName().equals("WAREHOUSE") && v0.getCatalogItem()
                        .getName().equals("STOCK")))
                        && ag_edge == null) {
                    LOG.debug("???????????\n");
                }

                //
                // If this other vertex is already replicated, then we don't
                // care
                //
                if (this.ptree.isReplicated(v1))
                    continue;

                //
                // If there is an edge between these two vertices, then check
                // whether
                // there is a path from the "upper" vertex to the "lower" vertex
                //
                if (ag_edge != null && this.ptree.getPath(v0, v1).isEmpty() && this.ptree.getPath(v1, v0).isEmpty() && graph.getPath(v0, v1).isEmpty() && graph.getPath(v1, v0).isEmpty()) {

                    //
                    // There was no edge in the PartitionTree, so that means we
                    // want to add
                    // an edge in our replication tree. Note that although edges
                    // in the AccessGraph
                    // are undirected, we need to make sure that our edge goes
                    // in the right direction.
                    // Well, that's easy then there is a foreign key but what
                    // about when it's just
                    // some random join?
                    //
                    boolean found = false;
                    for (int ctr = 0; ctr < 2; ctr++) {
                        if (ctr == 1) {
                            DesignerVertex temp = v0;
                            v0 = v1;
                            v1 = temp;
                        }
                        // Edge dg_edge = this.info.dgraph.findEdge(v0, v1);
                        // Edge dg_edge = this.agraph.findEdge(v0, v1);
                        if (this.info.dependencies.getDescendants((Table) v0.getCatalogItem()).contains(v1.getCatalogItem())) {
                            LOG.debug("CREATED EDGE: " + v0 + " -> " + v1 + "\n");
                            DesignerEdge new_edge = new DesignerEdge(graph, ag_edge);
                            graph.addEdge(new_edge, v0, v1, EdgeType.DIRECTED);
                            this.conflict_edges.add(new_edge);
                            this.conflict_vertices.add(v1);
                            found = true;
                            modified.add(v0);
View Full Code Here

                        if (parent != null && !ptree.containsVertex(element)) {
                            if (!ptree.containsVertex(parent))
                                ptree.addVertex(parent);
                            // System.out.println("FINAL GRAPH: " + parent +
                            // "->" + element);
                            DesignerEdge edge = new DesignerEdge(ptree);
                            ptree.addEdge(edge, parent, element, EdgeType.DIRECTED);
                            element.setAttribute(ptree, PartitionTree.VertexAttributes.PARENT_ATTRIBUTE.name(), entry.getParentAttribute());
                        }
                        // Root
                    } else if (!ptree.containsVertex(element)) {
View Full Code Here

TOP

Related Classes of edu.brown.designer.DesignerEdge

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.