Package org.voltdb.catalog

Examples of org.voltdb.catalog.Column


    public void testGenerateColumnOrder() throws Exception {
        AccessGraph agraph = this.partitioner.generateAccessGraph();
        assertNotNull(agraph);

        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
        Column expected[] = {
            this.getColumn(catalog_tbl, "S_ID"),
            this.getColumn(catalog_tbl, "SUB_NBR"),
            this.getColumn(catalog_tbl, "VLR_LOCATION"),
            this.getColumn(catalog_tbl, "BIT_1"),
            ReplicatedColumn.get(catalog_tbl),
View Full Code Here


        } // FOR
        assertFalse(vp_columns.isEmpty());
       
        // Make sure that each of these have a horizontal partition column
        // We expected to at least have a VerticalPartition with SUB_NBR in it
        Column expected_hp = this.getColumn(catalog_tbl, "S_ID");
        Column expected_vp = this.getColumn(catalog_tbl, "SUB_NBR");
        boolean found = false;
        for (VerticalPartitionColumn vp_col : vp_columns) {
            assertNotNull(vp_col);
            assertNotNull(vp_col.toString(), vp_col.getHorizontalColumn());
            assertNotNull(vp_col.toString(), vp_col.getVerticalMultiColumn());
View Full Code Here

                   
                    // Get the element from the entry that is not our column
                    CatalogType other = entry.getOther(catalog_col);
                    assertNotNull(other);
                    if ((other instanceof Column) == false) continue;
                    Column other_col = (Column)other;
                    System.err.println(String.format("catalog_col=%s, other_tbl=%s, other_col=%s",
                                                     catalog_col.fullName(), other_tbl.fullName(), other_col.fullName()));
                    assertEquals(e.toString(), other_tbl, other_col.getParent());
                   
                    // Make sure that the table's partitioning column matches 
                    assertEquals(String.format("%s<-->%s\n%s", catalog_tbl, other_tbl, e.toString()), other_tbl.getPartitioncolumn(), other_col);
                } // FOR (Edge)
            } // FOR (Column)
View Full Code Here

     hints.enable_vertical_partitioning = true;
     cp = new ConstraintPropagator(info, hints, agraph);
    
     // We're going to mark SUBSCRIBER as partitioned on S_ID and get the candidates for ACCESS_INFO 
     Table catalog_tbl0 = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
     Column catalog_col = this.getColumn(catalog_tbl0, "S_ID");
     catalog_tbl0.setPartitioncolumn(catalog_col);
     cp.update(catalog_tbl0);
     Table catalog_tbl1 = this.getTable(TM1Constants.TABLENAME_ACCESS_INFO);
     Collection<Column> expected_cols = cp.getCandidateValues(catalog_tbl1, Column.class);
     assertNotNull(expected_cols);
View Full Code Here

        List<Procedure> proc_visit_order = new ArrayList<Procedure>();
        List<Table> table_visit_order = (List<Table>)CollectionUtil.addAll(new ArrayList<Table>(), catalog_db.getTables());
       
        // Set the tables to all be partitioned on the last column
        for (Table catalog_tbl : catalog_db.getTables()) {
            Column catalog_col = this.getColumn(catalog_tbl, -1);
            catalog_tbl.setPartitioncolumn(catalog_col);
        } // FOR
       
        // Set this to be the upperbounds
        PartitionPlan ub_pplan = PartitionPlan.createFromCatalog(catalog_db);
View Full Code Here

        // We have to massage our attributes list so that our testing is deterministic. Set the only table
        // that we're going to visit is ACCESS_INFO and change its partitioning column to something that we know
        // we can beat if we partition on S_ID
        Map<Table, Column> expected = new HashMap<Table, Column>();
        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_SPECIAL_FACILITY);
        Column catalog_col = this.getColumn(catalog_tbl, -1);
        catalog_tbl.setPartitioncolumn(catalog_col);
        table_visit_order.add(catalog_tbl);
        expected.put(catalog_tbl, this.getColumn(catalog_tbl, "S_ID"));
       
        catalog_tbl = this.getTable(TM1Constants.TABLENAME_CALL_FORWARDING);
View Full Code Here

     * testTableEntrySerialization
     */
    @Test
    public void testTableEntrySerialization() throws Exception {
        Table catalog_tbl = this.getTable("DISTRICT");
        Column catalog_col = this.getColumn(catalog_tbl, "D_W_ID");
       
        Table parent_tbl = this.getTable("WAREHOUSE");
        Column parent_col = this.getColumn(parent_tbl, "W_ID");
       
        TableEntry entries[] = {
            new TableEntry(PartitionMethodType.REPLICATION, null, null, null),
            new TableEntry(PartitionMethodType.HASH, catalog_col, null, null),
            new TableEntry(PartitionMethodType.MAP, catalog_col, parent_tbl, parent_col),
View Full Code Here

    public void testProcedureColumns() throws Exception {
        this.partitioner.init(this.hints);
        Procedure catalog_proc = this.getProcedure(UpdateSubscriberData.class);
        Table catalog_tbl0 = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
        Table catalog_tbl1 = this.getTable(TM1Constants.TABLENAME_SPECIAL_FACILITY);
        Column expected[] = {
            this.getColumn(catalog_tbl0, "S_ID"),
            this.getColumn(catalog_tbl0, "BIT_1"),
            this.getColumn(catalog_tbl1, "DATA_A"),
            this.getColumn(catalog_tbl1, "S_ID"),
            this.getColumn(catalog_tbl1, "SF_TYPE")
View Full Code Here

    public void testProcedureColumnAccessHistogram() throws Exception {
        this.partitioner.init(this.hints);
        Procedure catalog_proc = this.getProcedure(UpdateSubscriberData.class);
        Table catalog_tbl0 = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
        Table catalog_tbl1 = this.getTable(TM1Constants.TABLENAME_SPECIAL_FACILITY);
        Column expected[] = {
            this.getColumn(catalog_tbl0, "S_ID"),
            this.getColumn(catalog_tbl0, "BIT_1"),
            this.getColumn(catalog_tbl1, "DATA_A"),
            this.getColumn(catalog_tbl1, "S_ID"),
            this.getColumn(catalog_tbl1, "SF_TYPE")
View Full Code Here

     */
    public void testGenerateMultiColumns() throws Exception {
        hints.enable_multi_partitioning = true;
        Procedure catalog_proc = this.getProcedure(GetAccessData.class);
        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_ACCESS_INFO);
        Column expected[] = {
            this.getColumn(catalog_tbl, "S_ID"),
            this.getColumn(catalog_tbl, "AI_TYPE"),
        };
       
        Map<Table, Collection<MultiColumn>> multicolumns = PartitionerUtil.generateMultiColumns(info, hints, catalog_proc);
View Full Code Here

TOP

Related Classes of org.voltdb.catalog.Column

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.