Package org.voltdb.catalog

Examples of org.voltdb.catalog.Table


     * @param tableName
     * @return an brand-new empty VoltTable whose corresponds tableName
     */
    public static VoltTable initVoltTable(String tableName)
    {
        Table t = getTable(tableName);
        VoltTable.ColumnInfo[] vtCols = new VoltTable.ColumnInfo[t.getColumns().size()];
        Iterator<Column> iCols = t.getColumns().iterator();
        while (iCols.hasNext())
        {
            Column c = iCols.next();
            vtCols[c.getIndex()] = new VoltTable.ColumnInfo(c.getName(), VoltType.get((byte) c.getType()));
        }
View Full Code Here


            }

            private Column getSelectedColumn(String sColName)
            {
                String sTblName = (String) m_lstTblName.getSelectedValue();
                Table table = TableEnv.getTable(sTblName);
                return table.getColumns().get(sColName);
            }
        });
    }
View Full Code Here

        m_lstTblName.addListSelectionListener(new ZListSelectionListener()
        {
            @Override
            public void whenSelecting(String selectedItemName)
            {
                Table table = TableEnv.getTable(selectedItemName);
                // display selected table's column information
                showTableColInfo(table);
                // display cardinality
                showTableCardinality();
                clearColumnEditPane();
View Full Code Here

       
        info = this.generateInfo(clone_catalogContext);
        TimeIntervalCostModel<SingleSitedCostModel> costModel = new TimeIntervalCostModel<SingleSitedCostModel>(clone_catalogContext, SingleSitedCostModel.class, 10);
        costModel.setCachingEnabled(true);
       
        Table catalog_tbl = this.getTable(clone_db, TM1Constants.TABLENAME_SUBSCRIBER);
        Column target_col = this.getColumn(catalog_tbl, "S_ID");
        Collection<VerticalPartitionColumn> candidates = VerticalPartitionerUtil.generateCandidates(target_col, info.stats);
        assertNotNull(candidates);
        assertFalse(candidates.isEmpty());
        VerticalPartitionColumn vpc = CollectionUtil.first(candidates);
View Full Code Here

       
        info = this.generateInfo(clone_catalogContext);
        SingleSitedCostModel costModel = new SingleSitedCostModel(clone_catalogContext);
        costModel.setCachingEnabled(true);
       
        Table catalog_tbl = this.getTable(clone_db, TM1Constants.TABLENAME_SUBSCRIBER);
        Column target_col = this.getColumn(catalog_tbl, "S_ID");
        Collection<VerticalPartitionColumn> candidates = VerticalPartitionerUtil.generateCandidates(target_col, info.stats);
        assertNotNull(candidates);
        assertFalse(candidates.isEmpty());
        VerticalPartitionColumn vpc = CollectionUtil.first(candidates);
View Full Code Here

        Database clone_db = CatalogCloner.cloneDatabase(catalog_db);
        CatalogContext clone_catalogContext = new CatalogContext(clone_db.getCatalog());
        PartitionEstimator p_estimator = new PartitionEstimator(clone_catalogContext);
        info = this.generateInfo(clone_catalogContext);
       
        Table catalog_tbl = this.getTable(clone_db, TM1Constants.TABLENAME_SUBSCRIBER);
        Column target_col = this.getColumn(catalog_tbl, "S_ID");
        Collection<VerticalPartitionColumn> candidates = VerticalPartitionerUtil.generateCandidates(target_col, info.stats);
        assertNotNull(candidates);
        assertFalse(candidates.isEmpty());
        VerticalPartitionColumn vpc = CollectionUtil.first(candidates);
View Full Code Here

    public void testCatalogUpdates() throws Exception {
        Database clone_db = CatalogCloner.cloneDatabase(catalog_db);
        CatalogContext clone_catalogContext = new CatalogContext(clone_db.getCatalog());
        info = this.generateInfo(clone_catalogContext);
       
        Table catalog_tbl = this.getTable(clone_db, TM1Constants.TABLENAME_SUBSCRIBER);
        Column target_col = this.getColumn(catalog_tbl, "S_ID");
        Collection<VerticalPartitionColumn> candidates = VerticalPartitionerUtil.generateCandidates(target_col, info.stats);
        assertNotNull(candidates);
        assertFalse(candidates.isEmpty());
        VerticalPartitionColumn vpc = CollectionUtil.first(candidates);
View Full Code Here

   
    /**
     * testCompileOptimizedStatements
     */
    public void testCompileOptimizedStatements() throws Exception {
        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
        if (CatalogUtil.getVerticalPartition(catalog_tbl) != null) {
            catalog_tbl.getViews().clear();
            assert(catalog_tbl.getViews().isEmpty());
        }
        Column catalog_cols[] = {
            this.getColumn(catalog_tbl, "S_ID"),
//            this.getColumn(catalog_tbl, "SUB_NBR"),
//            this.getColumn(catalog_tbl, "VLR_LOCATION"),
View Full Code Here

   
    /**
     * testGenerateCandidates
     */
    public void testGenerateCandidates() throws Exception {
        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
        Column target_col = this.getColumn(catalog_tbl, "S_ID");
       
        Collection<VerticalPartitionColumn> candidates = VerticalPartitionerUtil.generateCandidates(target_col, info.stats);
        assertNotNull(candidates);
        assertFalse(candidates.isEmpty());
View Full Code Here

   
    /**
     * testGenerateCandidatesAllColumns
     */
    public void testGenerateCandidatesAllColumns() throws Exception {
        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
        Column target_col = catalog_tbl.getPartitioncolumn();
        assertNotNull(target_col);
       
        for (Column catalog_col : catalog_tbl.getColumns()) {
            Collection<VerticalPartitionColumn> candidates = VerticalPartitionerUtil.generateCandidates(catalog_col, info.stats);
            assertEquals(candidates.toString(), catalog_col.equals(target_col), candidates.size() > 0);
        } // FOR
    }
View Full Code Here

TOP

Related Classes of org.voltdb.catalog.Table

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.