Package org.voltdb.catalog

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


        // 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);
        ddl_compiler.fillCatalogFromXML(catalog, catalog_db, xmlSchema);
View Full Code Here


            LOG.warn("The catalog file '" + CatalogUtil.CATALOG_FILENAME + "' in jar file '" + jar_path + "' is empty");
        } else {
            catalog = new Catalog();
            if (debug.val)
                LOG.debug("Extracted file '" + CatalogUtil.CATALOG_FILENAME + "' from jar file '" + jar_path + "'");
            catalog.execute(serializedCatalog);
        }
        return (catalog);
    }

    /**
 
View Full Code Here

        } else if (serializedCatalog.isEmpty()) {
            LOG.warn("The catalog file '" + CatalogUtil.CATALOG_FILENAME + "' in file '" + path + "' is empty");
        } else {
            catalog = new Catalog();
            LOG.debug("Executing catalog from file '" + path + "'");
            catalog.execute(serializedCatalog);
        }
        return (catalog);
    }

    /**
 
View Full Code Here

    }

    public Catalog createCatalog() throws Exception {
        Catalog new_catalog = new Catalog();
        new_catalog.execute(this.catalog_db.getCatalog().serialize());
        Database new_catalog_db = new_catalog.getClusters().get(this.catalog_db.getParent().getName()).getDatabases().get(this.catalog_db.getName());

        //
        // First apply the partitioning plan to all the tables
        //
View Full Code Here

            Catalog c = 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
                c.execute(serializedCatalog);
            } catch (Exception ex) {
                throw new RuntimeException("Failed to load " + projectBuilder.getProjectName() + " catalog [" + catalogJar + "]", ex);
            }
           
            CatalogContext cc = new CatalogContext(c, catalogJar);
View Full Code Here

        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

            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");

        //////////////////////
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

        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

            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

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.