Package org.voltdb.catalog

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


            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


        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

        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

            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

        byte[] bytes = MiscUtils.fileToBytes(new File(catalogJar));
        String serializedCatalog = CatalogUtil.getSerializedCatalogStringFromJar(CatalogUtil.loadAndUpgradeCatalogFromJar(bytes).getFirst());
        assertNotNull("Error loading catalog from jar", serializedCatalog);

        Catalog catalog = new Catalog();
        catalog.execute(serializedCatalog);

        // this should fail because group "bar" does not exist
        assertTrue("Deployment file shouldn't have been able to validate",
                CatalogUtil.compileDeployment(catalog, project.getPathToDeployment(), true, true) < 0);
    }
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

    private class MockExecutionSite extends ExecutionSite {
        public MockExecutionSite(long siteId, String serializedCatalog, SiteTracker tracker) {
            super(siteId);
            // get some catalog shortcuts ready
            Catalog catalog = new Catalog();
            catalog.execute(serializedCatalog);
            long now = System.currentTimeMillis();
            m_context = new CatalogContext( now, now, catalog, null, null, 0, 0);
            m_tracker = tracker;
        }
    }
View Full Code Here

        try {
            assertTrue(builder.compile("/tmp/snapshot_settings_test.jar"));
            final String catalogContents =
                VoltCompilerUtils.readFileFromJarfile("/tmp/snapshot_settings_test.jar", "catalog.txt");
            final Catalog cat = new Catalog();
            cat.execute(catalogContents);
            CatalogUtil.compileDeployment(cat, builder.getPathToDeployment(), true, false);
            SnapshotSchedule schedule =
                cat.getClusters().get("cluster").getDatabases().
                    get("database").getSnapshotschedule().get("default");
            assertEquals(32, schedule.getFrequencyvalue());
View Full Code Here

            boolean success = project.compile("/tmp/exportsettingstest.jar");
            assertTrue(success);
            final String catalogContents =
                VoltCompilerUtils.readFileFromJarfile("/tmp/exportsettingstest.jar", "catalog.txt");
            final Catalog cat = new Catalog();
            cat.execute(catalogContents);

            Connector connector = cat.getClusters().get("cluster").getDatabases().
                get("database").getConnectors().get("0");
            assertFalse(connector.getEnabled());
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.