Package org.voltdb.catalog

Examples of org.voltdb.catalog.Catalog


        // do all the work to get the catalog
        DatabaseType database = getProjectDatabase(projectReader);
        if (database == null) {
            return null;
        }
        final Catalog catalog = compileCatalogInternal(database, ddlReaderList, jarOutput);
        if (catalog == null) {
            return null;
        }

        // Build DDL from Catalog Data
        m_canonicalDDL = CatalogSchemaTools.toSchema(catalog, m_importLines);

        // generate the catalog report and write it to disk
        try {
            m_report = ReportMaker.report(m_catalog, m_warnings, m_canonicalDDL);
            File file = new File("catalog-report.html");
            FileWriter fw = new FileWriter(file);
            fw.write(m_report);
            fw.close();
            m_reportPath = file.getAbsolutePath();
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }

        jarOutput.put(AUTOGEN_DDL_FILE_NAME, m_canonicalDDL.getBytes(Constants.UTF8ENCODING));
        if (DEBUG_VERIFY_CATALOG) {
            debugVerifyCatalog(jarOutput, catalog);
        }

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

        byte[] catalogBytes = catalogCommands.getBytes(Constants.UTF8ENCODING);

        try {
            // Don't update buildinfo if it's already present, e.g. while upgrading.
View Full Code Here


            final InMemoryJarfile jarOutput)
    {
        // Compiler instance is reusable. Clear the cache.
        cachedAddedClasses.clear();

        m_catalog = new Catalog();
        // Initialize the catalog for one cluster
        m_catalog.execute("add / clusters cluster");
        m_catalog.getClusters().get("cluster").setSecurityenabled(false);

        if (database != null) {
View Full Code Here

     */
    public Catalog loadSchema(HSQLInterface hsql,
                              DdlProceduresToLoad whichProcs,
                              String... ddlFilePaths) throws VoltCompilerException
    {
        m_catalog = new Catalog(); //
        m_catalog.execute("add / clusters cluster");
        Database db = initCatalogDatabase();
        List<VoltCompilerReader> ddlReaderList = DDLPathsToReaderList(ddlFilePaths);
        final VoltDDLElementTracker voltDdlTracker = new VoltDDLElementTracker(this);
        InMemoryJarfile jarOutput = new InMemoryJarfile();
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();

        Catalog catalog = TPCCProjectBuilder.getTPCCSchemaCatalog();
        m_db = catalog.getClusters().get("cluster").getDatabases().get("database");

        URL url = TPCCProjectBuilder.class.getResource("tpcc-ddl.sql");
        m_hsql = HSQLInterface.loadHsqldb();
        try {
            m_hsql.runDDLFile(URLDecoder.decode(url.getPath(), "UTF-8"));
View Full Code Here

    protected void setUp() throws Exception {
        // For planner-only testing, we shouldn't care about IV2
        VoltDB.Configuration config = setUpSPDB();
        byte[] bytes = MiscUtils.fileToBytes(new File(config.m_pathToCatalog));
        String serializedCatalog = CatalogUtil.getSerializedCatalogStringFromJar(CatalogUtil.loadAndUpgradeCatalogFromJar(bytes).getFirst());
        Catalog catalog = new Catalog();
        catalog.execute(serializedCatalog);
        CatalogContext context = new CatalogContext(0, 0, catalog, bytes, null, 0, 0);
        m_pt = new PlannerTool(context.cluster, context.database, 0);
    }
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.