Package org.voltdb.catalog

Examples of org.voltdb.catalog.Catalog


    /**
     * testCreateSchemaCatalog
     */
    public void testCreateSchemaCatalog() throws Exception {
        Catalog s_catalog = new TPCEProjectBuilder().getSchemaCatalog(false);
        assertNotNull(s_catalog);
        Database s_catalog_db = CatalogUtil.getDatabase(s_catalog);
        assertNotNull(catalog_db);

        // ADDRESS should point to ZIP_CODE
View Full Code Here


    /**
     * testCloneCatalog
     */
    public void testCloneCatalog() throws Exception {
        Catalog clone = CatalogCloner.cloneBaseCatalog(catalog);
        assertNotNull(clone);

        for (Cluster catalog_clus : catalog.getClusters()) {
            Cluster clone_clus = clone.getClusters().get(catalog_clus.getName());
            assertNotNull(clone_clus);
            this.checkFields(Cluster.class, catalog_clus, clone_clus);
        } // FOR (Cluster)
    }
View Full Code Here

    /**
     * testClone
     */
    public void testCloneItem() throws Exception {
        Catalog clone = CatalogCloner.cloneBaseCatalog(catalog);
        assertNotNull(clone);
        CHECK_FIELDS_EXCLUDE.add("Table.constraints");
        CHECK_FIELDS_EXCLUDE.add("Column.constraints");

        // Test Table
View Full Code Here

        // either from a file or a fixed mappings, then we have
        // to load the catalog into this JVM, apply the mappings, and then
        // update the jar file with the new catalog
        if (m_paramMappingsFile != null || m_paramMappings.isEmpty() == false) {
            File jarFile = new File(jarPath);
            Catalog catalog = CatalogUtil.loadCatalogFromJar(jarFile);
            assert(catalog != null);
            Database catalog_db = CatalogUtil.getDatabase(catalog);
           
            this.applyParameterMappings(catalog_db);
           
View Full Code Here

    public CatalogContext deepCopy() {
        return new CatalogContext(catalog.deepCopy(), jarPath);
    }

    public CatalogContext update(String pathToNewJar, String diffCommands) {
        Catalog newCatalog = catalog.deepCopy();
        newCatalog.execute(diffCommands);
        CatalogContext retval = new CatalogContext(newCatalog, pathToNewJar);
        return retval;
    }
View Full Code Here

        if ((serializedCatalog == null) || (serializedCatalog.length() == 0)) {
            log("Catalog is null or empty");
            // need real error path
            System.exit(28);
        }
        Catalog catalog = new Catalog();
        catalog.execute(serializedCatalog);
        Cluster cluster = catalog.getClusters().get("cluster");
        Database db = cluster.getDatabases().get("database");
        log("catalog loaded");

        //////////////////////
        // LOAD HSQL
View Full Code Here

        // read in the catalog
        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

            assert (status);
        } catch (Exception ex) {
            throw new RuntimeException("Failed to create " + project_name + " catalog [" + catalogJar + "]", ex);
        }

        Catalog catalog = new Catalog();
        try {
            // read in the catalog
            String serializedCatalog = JarReader.readFileFromJarfile(catalogJar, CatalogUtil.CATALOG_FILENAME);
   
            // create the catalog (that will be passed to the ClientInterface
            catalog.execute(serializedCatalog);
        } catch (Exception ex) {
            throw new RuntimeException("Failed to load " + project_name + " catalog [" + catalogJar + "]", ex);
        }

        return catalog;
View Full Code Here

                new Object[] { clusterConfig.getLeaderAddress(),
                               clusterConfig.getHostCount(),
                               clusterConfig.getSitesPerHost() }, null);

        // do all the work to get the catalog
        final Catalog catalog = compileCatalog(projectFileURL, clusterConfig);
        if (catalog == null) {
            LOG.error("VoltCompiler had " + m_errors.size() + " errors\n" + StringUtil.join("\n", m_errors));
            return (false);
        }

        // WRITE CATALOG TO JAR HERE
        final String catalogCommands = catalog.serialize();

        byte[] catalogBytes = null;
        try {
            catalogBytes =  catalogCommands.getBytes("UTF-8");
        } catch (final UnsupportedEncodingException e1) {
View Full Code Here

    public void enableVerticalPartitionOptimizations() {
        m_enableVerticalPartitionOptimizations = true;
    }

    void compileXMLRootNode(ProjectType project) throws VoltCompilerException {
        m_catalog = new Catalog();
        temporaryCatalogInit();

        SecurityType security = project.getSecurity();
        if (security != null) {
            m_catalog.getClusters().get("cluster").
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.