Package org.voltdb.catalog

Examples of org.voltdb.catalog.Catalog.execute()


public class TestCatalogSerialization extends TestCase {

    public void testSimplest() {
        Catalog catalog1 = new Catalog();
        catalog1.execute(LoadCatalogToString.THE_CATALOG);

        String commands = catalog1.serialize();
        // System.out.println(commands);

        Catalog catalog2 = new Catalog();
View Full Code Here


        String commands = catalog1.serialize();
        // System.out.println(commands);

        Catalog catalog2 = new Catalog();
        try {
            catalog2.execute(commands);
        } catch (Exception e) {
            e.printStackTrace();
        }
        String commands2 = catalog2.serialize();
View Full Code Here

*/
public class TestExecutionEngine extends TestCase {

    public void testLoadCatalogs() throws Exception {
        Catalog catalog = new Catalog();
        catalog.execute(LoadCatalogToString.THE_CATALOG);
        sourceEngine.loadCatalog(catalog.serialize());
    }

    public void testLoadBadCatalogs() throws Exception {
        /*
 
View Full Code Here

        sourceEngine.loadTable(STOCK_TABLEID, stockdata, 0, 0, Long.MAX_VALUE, allowExport);
    }

    public void testLoadTable() throws Exception {
        Catalog catalog = new Catalog();
        catalog.execute(LoadCatalogToString.THE_CATALOG);
        sourceEngine.loadCatalog(catalog.serialize());

        int WAREHOUSE_TABLEID = warehouseTableId(catalog);
        int STOCK_TABLEID = stockTableId(catalog);
View Full Code Here

        assertEquals(1000, sourceEngine.serializeTable(STOCK_TABLEID).getRowCount());
    }

    public void testStreamTables() throws Exception {
        final Catalog catalog = new Catalog();
        catalog.execute(LoadCatalogToString.THE_CATALOG);
        sourceEngine.loadCatalog(catalog.serialize());
        ExecutionEngine destinationEngine = new ExecutionEngineJNI(null, CLUSTER_ID, NODE_ID, 0, 0, "");
        destinationEngine.loadCatalog(catalog.serialize());

        int WAREHOUSE_TABLEID = warehouseTableId(catalog);
View Full Code Here

        return catalog.getClusters().get("cluster").getDatabases().get("database").getTables().get("STOCK").getRelativeIndex();
    }

    public void testGetStats() throws Exception {
        final Catalog catalog = new Catalog();
        catalog.execute(LoadCatalogToString.THE_CATALOG);
        sourceEngine.loadCatalog(catalog.serialize());

        final int WAREHOUSE_TABLEID = catalog.getClusters().get("cluster").getDatabases().get("database").getTables().get("WAREHOUSE").getRelativeIndex();
        final int STOCK_TABLEID = catalog.getClusters().get("cluster").getDatabases().get("database").getTables().get("STOCK").getRelativeIndex();
        final int locators[] = new int[] { WAREHOUSE_TABLEID, STOCK_TABLEID };
View Full Code Here

{
    public void testNonZeroReplicationFactor()
    {
        ClusterConfig config = new ClusterConfig(3, 1, 2, "localhost");
        Catalog catalog = new Catalog();
        catalog.execute("add / clusters cluster");
        ClusterCompiler.compile(catalog, config);
        System.out.println(catalog.serialize());
        Cluster cluster = catalog.getClusters().get("cluster");
        Collection<Partition> partitions = CatalogUtil.getAllPartitions(cluster);
        // despite 3 hosts, should only have 1 partition with k-safety of 2
View Full Code Here

    {
        // 2 hosts, 6 sites per host, 2 copies of each partition.
        // there are sufficient execution sites, but insufficient hosts
        ClusterConfig config = new ClusterConfig(2, 6, 2, "localhost");
        Catalog catalog = new Catalog();
        catalog.execute("add / clusters cluster");
        boolean caught = false;
        try
        {
            ClusterCompiler.compile(catalog, config);
        }
View Full Code Here

        String serializedCatalog = CatalogUtil.loadCatalogFromJar(catalogJar, null);
        assert(serializedCatalog != null);

        // create the catalog (that will be passed to the ClientInterface
        Catalog catalog = new Catalog();
        catalog.execute(serializedCatalog);

        return catalog;
    }

    /**
 
View Full Code Here

        //
        // Setup fake database connection. Pass stuff to database to get catalog
        // objects
        //
        Catalog catalog = new Catalog();
        catalog.execute("add / clusters " + CatalogUtil.DEFAULT_CLUSTER_NAME);
        catalog.execute("add /clusters[" + CatalogUtil.DEFAULT_CLUSTER_NAME + "] databases " + CatalogUtil.DEFAULT_DATABASE_NAME);
        Database catalog_db = catalog.getClusters().get(CatalogUtil.DEFAULT_CLUSTER_NAME).getDatabases().get(CatalogUtil.DEFAULT_DATABASE_NAME);

        VoltCompiler compiler = new VoltCompiler();
        DDLCompiler ddl_compiler = new DDLCompiler(compiler, hzsql);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.