Package org.voltdb.compiler

Examples of org.voltdb.compiler.DeploymentBuilder


            catBuilder.addProcedures(ArbitraryDurationProc.class);

            boolean success = catBuilder.compile(Configuration.getPathToCatalogForTest("timeouts.jar"));
            assert(success);

            depBuilder = new DeploymentBuilder(1, 1, 0);
            depBuilder.writeXML(Configuration.getPathToCatalogForTest("timeouts.xml"));

            VoltDB.Configuration config = new VoltDB.Configuration();
            config.m_pathToCatalog = Configuration.getPathToCatalogForTest("timeouts.jar");
            config.m_pathToDeployment = Configuration.getPathToCatalogForTest("timeouts.xml");
View Full Code Here


        String pathToCatalog = Configuration.getPathToCatalogForTest("adhocddl.jar");
        String pathToDeployment = Configuration.getPathToCatalogForTest("adhocddl.xml");
        VoltProjectBuilder builder = new VoltProjectBuilder();
        // Need to parallel dbuilder as we modify builder
        DeploymentBuilder dbuilder = new DeploymentBuilder(2, 1, 0);
        builder.addLiteralSchema(
                "create table FOO (" +
                "ID integer not null," +
                "VAL bigint, " +
                "constraint PK_TREE primary key (ID)" +
                ");\n" +
                "create table FOO_R (" +
                "ID integer not null," +
                "VAL bigint, " +
                "constraint PK_TREE_R primary key (ID)" +
                ");\n"
                );
        builder.addPartitionInfo("FOO", "ID");
        dbuilder.setUseDDLSchema(true);
        dbuilder.addUsers(new DeploymentBuilder.UserInfo[]
                {new DeploymentBuilder.UserInfo("admin", "admin", new String[] {"ADMINISTRATOR"})});
        dbuilder.setSecurityEnabled(true);
        dbuilder.setEnableCommandLogging(false);
        boolean success = builder.compile(pathToCatalog, 2, 1, 0);
        assertTrue("Schema compilation failed", success);
        dbuilder.writeXML(pathToDeployment);
        //MiscUtils.copyFile(builder.getPathToDeployment(), pathToDeployment);

        VoltDB.Configuration config = new VoltDB.Configuration();
        config.m_pathToCatalog = pathToCatalog;
        config.m_pathToDeployment = pathToDeployment;

        try {
            startServer(config);
            ClientConfig adminConfig = new ClientConfig("admin", "admin");
            Client adminClient = ClientFactory.createClient(adminConfig);
            ClientConfig userConfig = new ClientConfig("user", "user");
            Client userClient = ClientFactory.createClient(userConfig);

            adminClient.createConnection("localhost");
            // Can't connect a user which doesn't exist
            boolean threw = false;
            try {
                userClient.createConnection("localhost");
            }
            catch (IOException ioe) {
                threw = true;
                assertTrue(ioe.getMessage().contains("Authentication rejected"));
            }
            assertTrue("Connecting bad user should have failed", threw);

            // Try to add a user with a new role to the system
            dbuilder.addUsers(new UserInfo[]
                    {new UserInfo("user", "user", new String[] {"NEWROLE"})});
            dbuilder.writeXML(pathToDeployment);
            threw = false;
            try {
                adminClient.updateApplicationCatalog(null, new File(pathToDeployment));
            }
            catch (ProcCallException pce) {
View Full Code Here

            String catPath1 = catalogPathForTable(t1, "t1.jar");
            String catPath2 = catalogPathForTable(t2, "t2.jar");
            byte[] catBytes2 = MiscUtils.fileToBytes(new File(catPath2));

            DeploymentBuilder depBuilder = new DeploymentBuilder(1, 1, 0);
            depBuilder.setVoltRoot("/tmp/foobar");
            // disable logging
            depBuilder.configureLogging("/tmp/foobar", "/tmp/foobar", false, false, 1, 1, 3);
            String deployment = depBuilder.getXML();
            File deploymentFile = VoltProjectBuilder.writeStringToTempFile(deployment);

            VoltDB.Configuration config = new VoltDB.Configuration();
            config.m_pathToDeployment = deploymentFile.getAbsolutePath();
            config.m_pathToCatalog = catPath1;
View Full Code Here

                TableHelper.randomFill(t1, 1000, 1024, new Random(0));
            }

            String catPath1 = catalogPathForTable(t1, "t1.jar");

            DeploymentBuilder depBuilder = new DeploymentBuilder(1, 1, 0);
            depBuilder.setVoltRoot("/tmp/foobar");
            depBuilder.setUseDDLSchema(true);
            // disable logging
            depBuilder.configureLogging("/tmp/foobar", "/tmp/foobar", false, false, 1, 1, 3);
            String deployment = depBuilder.getXML();
            File deploymentFile = VoltProjectBuilder.writeStringToTempFile(deployment);

            VoltDB.Configuration config = new VoltDB.Configuration();
            config.m_pathToDeployment = deploymentFile.getAbsolutePath();
            config.m_pathToCatalog = catPath1;
View Full Code Here

TOP

Related Classes of org.voltdb.compiler.DeploymentBuilder

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.