Package org.voltdb.catalog

Examples of org.voltdb.catalog.Catalog


            }
        }
       
        // this should reorder the tables and partitions all alphabetically
        String catData = m_catalog.serialize();
        m_catalog = new Catalog();
        m_catalog.execute(catData);
        db = m_catalog.getClusters().get("cluster").getDatabases().get(databaseName);
       
        // add database estimates info
        addDatabaseEstimatesInfo(m_estimates, db);
View Full Code Here


            String newCatalogCommands = CatalogUtil.loadCatalogFromJar(work.catalogURL, null);
            if (newCatalogCommands == null) {
                retval.errorMsg = "Unable to read from catalog at: " + work.catalogURL;
                return retval;
            }
            Catalog newCatalog = new Catalog();
            newCatalog.execute(newCatalogCommands);

            // get the current catalog
            CatalogContext context = VoltDB.instance().getCatalogContext();

            // store the version of the catalog the diffs were created against.
View Full Code Here

    /**
     * testAddHostInfo
     */
    public void testAddHostInfo() throws Exception {
        Catalog new_catalog = FixCatalog.cloneCatalog(catalog, NUM_HOSTS, NUM_SITES_PER_HOST, NUM_PARTITIONS_PER_SITE);
        Cluster catalog_clus = CatalogUtil.getCluster(new_catalog);
        assertEquals(NUM_PARTITIONS_PER_SITE * NUM_SITES_PER_HOST * NUM_HOSTS, CatalogUtil.getNumberOfPartitions(new_catalog));

        Set<Host> seen_hosts = new HashSet<Host>();
        Set<Site> seen_sites = new HashSet<Site>();
View Full Code Here

            obj.put("drPort", drPort);
            obj.put("drInterface", "127.0.0.1");

            m_localMetadata = obj.toString(4);

            m_catalog = new Catalog();
            m_catalog.execute("add / clusters " + m_clusterName);
            m_catalog.execute("add " + m_catalog.getClusters().get(m_clusterName).getPath() + " databases " +
                    m_databaseName);
            Cluster cluster = m_catalog.getClusters().get(m_clusterName);
            // Set a sane default for TestMessaging (at least)
View Full Code Here

            if ((serializedCatalog == null) || (serializedCatalog.length() == 0))
                VoltDB.crashLocalVoltDB("Catalog loading failure", false, null);

            /* N.B. node recovery requires discovering the current catalog version. */
            Catalog catalog = new Catalog();
            catalog.execute(serializedCatalog);
            serializedCatalog = null;

            // note if this fails it will print an error first
            try {
                //This is where we compile real catalog and create runtime catalog context. To validate deployment
View Full Code Here

        byte[] bytes = MiscUtils.fileToBytes(new File(catalogJar));
        String serializedCatalog =
            CatalogUtil.getSerializedCatalogStringFromJar(CatalogUtil.loadAndUpgradeCatalogFromJar(bytes).getFirst());

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

        // update the catalog with the data from the deployment file
        String pathToDeployment = pb.getPathToDeployment();
        assertTrue(CatalogUtil.compileDeployment(catalog, pathToDeployment, true, false) >= 0);
View Full Code Here

        VoltCompiler compiler = new VoltCompiler();
        boolean success = compiler.compileFromDDL(jarOut.getPath(), schemaPath);
        assertTrue("Compilation failed unexpectedly", success);

        Catalog catalog = new Catalog();
        catalog.execute(CatalogUtil.getSerializedCatalogStringFromJar(CatalogUtil.loadAndUpgradeCatalogFromJar(MiscUtils.fileToBytes(new File(jarOut.getPath()))).getFirst()));

        Database db = catalog.getClusters().get("cluster").getDatabases().get("database");
        Table t = db.getTables().get("T");
        assertEquals("C2", t.getPartitioncolumn().getTypeName());
    }
View Full Code Here

            retval.upgradedFromVersion = loadResults.getSecond();
            if (newCatalogCommands == null) {
                retval.errorMsg = "Unable to read from catalog bytes";
                return retval;
            }
            Catalog newCatalog = new Catalog();
            newCatalog.execute(newCatalogCommands);

            // Retrieve the original deployment string, if necessary
            if (deploymentString == null) {
                // Go get the deployment string from ZK.  Hope it's there and up-to-date.  Yeehaw!
                CatalogAndIds catalogStuff =
View Full Code Here

        VoltCompiler compiler = new VoltCompiler();
        boolean success = compiler.compileFromDDL(jarOut.getPath(), schemaPath);
        assertTrue("Compilation failed unexpectedly", success);

        Catalog catalog = new Catalog();
        catalog.execute(CatalogUtil.getSerializedCatalogStringFromJar(CatalogUtil.loadAndUpgradeCatalogFromJar(MiscUtils.fileToBytes(new File(jarOut.getPath()))).getFirst()));

        Database db = catalog.getClusters().get("cluster").getDatabases().get("database");
        Table t = db.getTables().get("T");
        assertEquals(null, t);
    }
View Full Code Here

        VoltCompiler compiler = new VoltCompiler();
        boolean success = compiler.compileFromDDL(jarOut.getPath(), schemaPath);
        assertTrue("Compilation failed unexpectedly", success);

        Catalog catalog = new Catalog();
        catalog.execute(CatalogUtil.getSerializedCatalogStringFromJar(CatalogUtil.loadAndUpgradeCatalogFromJar(MiscUtils.fileToBytes(new File(jarOut.getPath()))).getFirst()));

        Database db = catalog.getClusters().get("cluster").getDatabases().get("database");
        Table t = db.getTables().get("T");
        assertEquals(null, t);
    }
View Full Code Here

TOP

Related Classes of org.voltdb.catalog.Catalog

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.