Package org.voltdb.catalog

Examples of org.voltdb.catalog.CatalogType


                Object value = catalog_obj.getField(field);
                m[0].put(field, value);
               
                // Specialized Output
                if (value != null && catalog_fields.contains(field)) {
                    CatalogType catalog_item = null;
                    if (value instanceof CatalogType) {
                        catalog_item = (CatalogType)value;
                    } else if (value instanceof CatalogType.UnresolvedInfo) {
                        catalog_item = catalog.getItemForRef(((UnresolvedInfo)value).path);
                    } else {
                        assert(false) : "Unexpected value '" + value + "' for field '" + field + "'";
                    }
                   
                    if (catalog_item != null) {
                        boolean include_class = show_type.contains(catalog_item.getClass());
                        m[0].put(field, CatalogUtil.getDisplayName(catalog_item, include_class));
                    } else {
                        m[0].put(field, catalog_item);
                    }
                }
View Full Code Here


                    new_cset.add(entry);
                    new_e = new DesignerEdge(agraph, e);
                    new_e.setAttribute(EdgeAttributes.COLUMNSET, new_cset);
                    entry_edges.put(entry, new_e);

                    CatalogType parent0 = entry.getFirst().getParent();
                    CatalogType parent1 = entry.getSecond().getParent();

                    if (parent0 == null && parent1 == null) {
                        if (d)
                            LOG.debug(String.format("Skipping %s ===> %s, %s", entry, v0, v1));
                        continue;

                        // Check whether this is a self-referencing edge
                    } else if ((parent0 == null && parent1.equals(catalog_tbl0)) || (parent1 == null && parent0.equals(catalog_tbl0))) {
                        if (d)
                            LOG.debug(String.format("Self-referencing edge %s ===> %s, %s", entry, v0, v0));
                        agraph.addEdge(new_e, v0, v0);

                    } else if ((parent0 == null && parent1.equals(catalog_tbl1)) || (parent1 == null && parent0.equals(catalog_tbl1))) {
                        if (d)
                            LOG.debug(String.format("Self-referencing edge %s ===> %s, %s", entry, v1, v1));
                        agraph.addEdge(new_e, v1, v1);

                    } else if ((parent0.equals(catalog_tbl0) && parent1.equals(catalog_tbl1) == false) || (parent1.equals(catalog_tbl0) && parent0.equals(catalog_tbl1) == false)
                            || (parent0.equals(catalog_tbl0) && parent1.equals(catalog_tbl0))) {
                        if (d)
                            LOG.debug(String.format("Self-referencing edge %s ===> %s, %s", entry, v0, v0));
                        agraph.addEdge(new_e, v0, v0);

                    } else if ((parent0.equals(catalog_tbl1) && parent1.equals(catalog_tbl0) == false) || (parent1.equals(catalog_tbl1) && parent0.equals(catalog_tbl0) == false)
                            || (parent0.equals(catalog_tbl0) && parent1.equals(catalog_tbl0))) {
                        if (d)
                            LOG.debug(String.format("Self-referencing edge %s ===> %s, %s", entry, v1, v1));
                        agraph.addEdge(new_e, v1, v1);

                    } else {
View Full Code Here

           
        } // FOR

        // *********************************** DEBUG ***********************************
        if (debug.val) {
            CatalogType catalog_obj = null;
            if (ts.isSysProc()) {
                catalog_obj = ts.getProcedure();
            } else {
                for (int i = 0; i < num_fragments; i++) {
                    int frag_id = fragment.getFragmentId(i);
View Full Code Here

        cset.add(this.getColumn(catalog_tbl, "NO_O_ID"), this.getColumn(this.catalog_tbl1, "O_ID"));
        // And that two columns from the same table are sorted
        cset.add(this.getColumn(catalog_tbl1, "O_ID"), this.getColumn(this.catalog_tbl1, "O_D_ID"));
        for (CatalogPair e : cset) {
            assertNotNull(e);
            CatalogType first = e.getFirst();
            assertNotNull(first);
            CatalogType second = e.getSecond();
            assertNotNull(second);
            assert(first.compareTo(second) <= 0) : first + " > " + second;
        } // FOR
       
        // Now check that if we add duplicate entries they don't get added again
View Full Code Here

        Collection<CatalogType> match0 = cset.findAllForOther(CatalogType.class, catalog_col);
        assertNotNull(match0);
        assertFalse(match0.isEmpty());
        assertEquals(2, match0.size());
       
        CatalogType expected0 = this.getColumn(catalog_tbl1, "O_W_ID");
        assert(match0.contains(expected0)) : "Missing " + expected0;
        CatalogType expected1 = this.getProcParameter(catalog_proc, 0);
        assert(match0.contains(expected1)) : "Missing " + expected1;
       
        // Search again, but this type specify that we only want ProcParameters
        // Now we should only get back one result
        Collection<ProcParameter> match1 = cset.findAllForOther(ProcParameter.class, catalog_col);
View Full Code Here

    private void Tester_getFromKey(CatalogType catalog_item) {
        assertNotNull(catalog_item);
        String key = CatalogKey.createKey(catalog_item);
        assertFalse(key.isEmpty());
        CatalogType clone = CatalogKey.getFromKey(catalog_db, key, catalog_item.getClass());
        assertNotNull(clone);
        assertEquals(catalog_item, clone);
    }
View Full Code Here

                assertEquals("Mismatched CatalogMap sizes for " + field_name, map0.size(), map1.size());

                Class<? extends CatalogType> generic_class = (Class<? extends CatalogType>) map0.getGenericClass();
                assert (generic_class != null);

                CatalogType map0_values[] = map0.values();
                CatalogType map1_values[] = map0.values();
                for (int i = 0, cnt = map0.size(); i < cnt; i++) {
                    CatalogType child0 = map0_values[i];
                    assertNotNull("Null child element at index " + i + " for " + field_name, child0);
                    CatalogType child1 = map1_values[i];
                    assertNotNull("Null child element at index " + i + " for " + field_name, child1);
                    this.checkFields(generic_class, child0, child1);
                } // FOR
            }
            // ConstraintRefs
            else if (field_val0 instanceof ConstraintRef) {
                ConstraintRef ref0 = (ConstraintRef) field_val0;
                ConstraintRef ref1 = (ConstraintRef) field_val1;
                if (debug)
                    System.err.println(CatalogUtil.getDisplayName(ref0) + " <-> " + CatalogUtil.getDisplayName(ref1));
                this.checkFields(Column.class, ref0.getConstraint(), ref1.getConstraint());
            }
            // TableRefs
            else if (field_val0 instanceof TableRef) {
                TableRef ref0 = (TableRef) field_val0;
                TableRef ref1 = (TableRef) field_val1;
                if (debug)
                    System.err.println(CatalogUtil.getDisplayName(ref0) + " <-> " + CatalogUtil.getDisplayName(ref1));
                this.checkFields(Table.class, ref0.getTable(), ref1.getTable());
            }
            // ColumnRefs
            else if (field_val0 instanceof ColumnRef) {
                ColumnRef ref0 = (ColumnRef) field_val0;
                ColumnRef ref1 = (ColumnRef) field_val1;
                if (debug)
                    System.err.println(CatalogUtil.getDisplayName(ref0) + " <-> " + CatalogUtil.getDisplayName(ref1));
                this.checkFields(Column.class, ref0.getColumn(), ref1.getColumn());
            }
            // CatalogMap
            else if (field_val0 != null && ClassUtil.getSuperClasses(field_val0.getClass()).contains(CatalogType.class)) {
                CatalogType type0 = (CatalogType) field_val0;
                CatalogType type1 = (CatalogType) field_val1;
                if (debug)
                    System.err.println(CatalogUtil.getDisplayName(type0) + " <-> " + CatalogUtil.getDisplayName(type1));
                assertEquals("Mismatched values for " + field_name, type0.getName(), type1.getName());
            }
            // Scalar
            else {
                if (debug)
                    System.err.println(field_val0 + " <-> " + field_val1);
View Full Code Here

     * @param frag Catalog fragment to identify
     * @return unique id for fragment
     */
    public static long getUniqueIdForFragment(PlanFragment frag) {
        long retval = 0;
        CatalogType parent = frag.getParent();
        retval = ((long) parent.getParent().getRelativeIndex()) << 32;
        retval += ((long) parent.getRelativeIndex()) << 16;
        retval += frag.getRelativeIndex();

        return retval;
    }
View Full Code Here

TOP

Related Classes of org.voltdb.catalog.CatalogType

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.