Package org.voltdb.catalog

Examples of org.voltdb.catalog.Table


        this.anticache_dir = FileUtil.getTempDirectory();
       
        // Just make sure that the Table has the evictable flag set to true
        this.locators = new int[TARGET_TABLES.length];
        for (int i = 0; i < TARGET_TABLES.length; i++) {
            Table catalog_tbl = getTable(TARGET_TABLES[i]);
            assertTrue(catalog_tbl.getEvictable());
            this.locators[i] = catalog_tbl.getRelativeIndex();
        } // FOR
       
        Site catalog_site = CollectionUtil.first(catalogContext.sites);
        this.hstore_conf = HStoreConf.singleton();
        this.hstore_conf.site.anticache_enable = true;
View Full Code Here


            this.loadData(this.getTable(tableName));
        }
       
        // Then make sure that we can evict from each of them
        for (String tableName : TARGET_TABLES) {
            Table catalog_tbl = this.getTable(tableName);
            VoltTable evictResult = this.evictData(catalog_tbl);
            evictResult.advanceRow();

            // Our stats should now come back with at least one block evicted
            VoltTable results[] = this.ee.getStats(SysProcSelector.TABLE, this.locators, false, 0L);
            assertEquals(1, results.length);
            // System.err.println("-------------------------------");
            // System.err.println(VoltTableUtil.format(results));

            while (results[0].advanceRow()) {
                if (results[0].getString("TABLE_NAME").equalsIgnoreCase(catalog_tbl.getName()) == false)
                    continue;
                for (String col : statsFields) {
                    assertEquals(col, evictResult.getLong(col), results[0].getLong(col));
                    if (col == "ANTICACHE_BLOCKS_EVICTED") {
                        assertEquals(col, 1, results[0].getLong(col));
View Full Code Here

            int i = 0;
            CatalogContext catalogContext = hstore_site.getCatalogContext();
            String children[] = new String[pdist.size()];
            for (String table : pdist.keySet()) {
                tableNames[i] = table;
                Table catalogTable = catalogContext.getTableByName(table);
                if(hstore_conf.site.anticache_batching == true){
                    children = CatalogUtil.getChildTables(catalogContext.database, catalogTable);
                    System.out.println(children);                 
                }
                evictBlockSizes[i] = hstore_conf.site.anticache_block_size;
View Full Code Here

   
    /**
     * testMultiColumn
     */
    public void testMultiColumn() throws Exception {
        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
        Column columns[] = {
            this.getColumn(catalog_tbl, "S_ID"),
            this.getColumn(catalog_tbl, "SUB_NBR"),
        };
       
View Full Code Here

    /**
     * testVerticalPartitionColumn
     */
    @SuppressWarnings("unchecked")
    public void testVerticalPartitionColumn() throws Exception {
        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
        Column orig_hp_col = this.getColumn(catalog_tbl, "S_ID");
        MultiColumn orig_vp_col = MultiColumn.get(this.getColumn(catalog_tbl, "S_ID"),
                                                  this.getColumn(catalog_tbl, "SUB_NBR"));
       
        VerticalPartitionColumn item0 = VerticalPartitionColumn.get(orig_hp_col, orig_vp_col);
View Full Code Here

        assertFalse(this.checker.hasConflictBefore(ts0, ts1, BASE_PARTITION));
        assertFalse(this.checker.hasConflictAfter(ts0, ts1, BASE_PARTITION));
       
        // Finally, we'll pick a random table to have the second txn write to.
        // That should get the checker to mark them as conflicting
        Table tbl = CollectionUtil.random(tables);
        assertNotNull(tbl);
        this.addWrites(ts1, tbl, 1111);
        assertFalse(this.checker.hasConflictBefore(ts0, ts1, BASE_PARTITION));
        assertTrue(this.checker.hasConflictAfter(ts0, ts1, BASE_PARTITION));
    }
View Full Code Here

        assertFalse(this.checker.hasConflictBefore(ts0, ts1, BASE_PARTITION));
        assertFalse(this.checker.hasConflictAfter(ts0, ts1, BASE_PARTITION));
       
        // Finally, we'll pick a random table to have the second txn write to.
        // That should get the checker to mark them as conflicting
        Table tbl = CollectionUtil.random(tables);
        assertNotNull(tbl);
        this.addWrites(ts1, tbl, 1111);
        assertFalse(this.checker.hasConflictBefore(ts0, ts1, BASE_PARTITION));
        assertTrue(this.checker.hasConflictAfter(ts0, ts1, BASE_PARTITION));
    }
View Full Code Here

        this.notifyAfter.drainPermits();
       
        // We want to always insert one SUBSCRIBER record per partition so
        // that we can play with them. Set VLR_LOCATION to zero so that
        // can check whether it has been modified
        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
        Column catalog_col = this.getColumn(catalog_tbl, "VLR_LOCATION");
        VoltTable vt = CatalogUtil.getVoltTable(catalog_tbl);
        for (int i = 0; i < NUM_PARTITIONS; i++) {
            Object row[] = VoltTableUtil.getRandomRow(catalog_tbl);
            row[0] = new Long(i);
            row[catalog_col.getIndex()] = 0l;
            vt.addRow(row);
        } // FOR
        String procName = VoltSystemProcedure.procCallName(LoadMultipartitionTable.class);
        ClientResponse cr = this.client.callProcedure(procName, catalog_tbl.getName(), vt);
        assertEquals(cr.toString(), Status.OK, cr.getStatus());
    }
View Full Code Here

        this.numAccounts = (int)Math.round(SmallBankConstants.NUM_ACCOUNTS *
                                           this.getScaleFactor());
       
        // Calculate account name length
        CatalogContext catalogContext = this.getCatalogContext();
        Table catalog_tbl = catalogContext.getTableByName(SmallBankConstants.TABLENAME_ACCOUNTS);
        int acctNameLength = -1;
        for (Column col : catalog_tbl.getColumns()) {
            if (col.getType() == VoltType.STRING.getValue()) {
                acctNameLength = col.getSize();
                break;
            }
        } // FOR
View Full Code Here

   
    @Override
    protected void loadFromJSONObject(final JSONObject obj, Database db) throws JSONException {
        m_targetTableName = obj.getString(Members.TARGET_TABLE_NAME.name());
        if (db != null || m_targetTableName.equals("")) {
            Table table = db.getTables().get(m_targetTableName);
            if (table == null) {
                throw new JSONException("Unable to retrieve catalog object for table '" + m_targetTableName + "'");
            }
        }
    }
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.