Package org.voltdb.compiler

Examples of org.voltdb.compiler.VoltProjectBuilder.addPartitionInfo()


                                 "where created <= ? and id < ? " +
                                 "order by created desc, id desc " +
                                 "limit ?;",
                                 "items.id:1");

        project.addPartitionInfo("items", "id");
        boolean success = project.compile(Configuration.getPathToCatalogForTest("poc.jar"));
        if (!success) {
            System.err.println("Failure to compile catalog.");
            System.exit(-1);
        }
View Full Code Here


            // a partitioned table that should not generate procedures (pkey not partition key)
            project.addLiteralSchema(
                    "CREATE TABLE p3(a1 INTEGER NOT NULL, a2 VARCHAR(10) NOT NULL); " +
                    "CREATE ASSUMEUNIQUE INDEX p3_tree_idx ON p3(a1);"
            );
            project.addPartitionInfo("p3", "a2");

            // a replicated table (should not generate procedures).
            project.addLiteralSchema(
                    "CREATE TABLE r1(a1 INTEGER NOT NULL, a2 VARCHAR(10) NOT NULL, PRIMARY KEY (a1));"
            );
View Full Code Here

            // table with a multi-column pkey. verify that pkey column ordering is
            // in the index column order, not table order and not index column lex. order
            project.addLiteralSchema(
                    "CREATE TABLE p4(z INTEGER NOT NULL, x VARCHAR(10) NOT NULL, y INTEGER NOT NULL, PRIMARY KEY(y,x,z));"
            );
            project.addPartitionInfo("p4", "y");

        } catch (IOException error) {
            fail(error.getMessage());
        }
View Full Code Here

            "PRIMARY KEY(ID))\n;" +
            "create table DROPME_R (" +
            "ID int default 0 not null, " +
            "VAL varchar(32) default null," +
            "PRIMARY KEY(ID));");
        builder.addPartitionInfo("BLAH", "ID");
        builder.addPartitionInfo("DROPME", "ID");
        builder.setUseDDLSchema(true);
        boolean success = builder.compile(pathToCatalog, 2, 1, 0);
        assertTrue("Schema compilation failed", success);
        MiscUtils.copyFile(builder.getPathToDeployment(), pathToDeployment);
View Full Code Here

            "create table DROPME_R (" +
            "ID int default 0 not null, " +
            "VAL varchar(32) default null," +
            "PRIMARY KEY(ID));");
        builder.addPartitionInfo("BLAH", "ID");
        builder.addPartitionInfo("DROPME", "ID");
        builder.setUseDDLSchema(true);
        boolean success = builder.compile(pathToCatalog, 2, 1, 0);
        assertTrue("Schema compilation failed", success);
        MiscUtils.copyFile(builder.getPathToDeployment(), pathToDeployment);
View Full Code Here

        MultiConfigSuiteBuilder builder =
            new MultiConfigSuiteBuilder(TestSystemCatalogSuite.class);

        VoltProjectBuilder project = new VoltProjectBuilder();
        project.addLiteralSchema("CREATE TABLE T(A1 INTEGER NOT NULL, A2 INTEGER, PRIMARY KEY(A1));");
        project.addPartitionInfo("T", "A1");
        project.addStmtProcedure("InsertA", "INSERT INTO T VALUES(?,?);", "T.A1: 0");

        LocalCluster lcconfig = new LocalCluster("getclusterinfo-cluster.jar", 2, 2, 1,
                                               BackendTarget.NATIVE_EE_JNI);
        lcconfig.compile(project);
View Full Code Here

            "VAL varchar(32) default null," +
            "PRIMARY KEY(ID));\n" +
            "create assumeunique index pkey_idx on DROPME(VAL);\n" +
            "create view BLAT (VAL, TOTAL) as select VAL, COUNT(*) from VIEWBASE group by VAL;\n"
            );
        builder.addPartitionInfo("BLAH", "ID");
        builder.addPartitionInfo("DROPME", "ID");
        builder.addStmtProcedure("BLERG", "select * from BLAH where ID = ?");
        builder.setUseDDLSchema(true);
        boolean success = builder.compile(pathToCatalog, 2, 1, 0);
        assertTrue("Schema compilation failed", success);
View Full Code Here

            "PRIMARY KEY(ID));\n" +
            "create assumeunique index pkey_idx on DROPME(VAL);\n" +
            "create view BLAT (VAL, TOTAL) as select VAL, COUNT(*) from VIEWBASE group by VAL;\n"
            );
        builder.addPartitionInfo("BLAH", "ID");
        builder.addPartitionInfo("DROPME", "ID");
        builder.addStmtProcedure("BLERG", "select * from BLAH where ID = ?");
        builder.setUseDDLSchema(true);
        boolean success = builder.compile(pathToCatalog, 2, 1, 0);
        assertTrue("Schema compilation failed", success);
        MiscUtils.copyFile(builder.getPathToDeployment(), pathToDeployment);
View Full Code Here

        MultiConfigSuiteBuilder builder =
            new MultiConfigSuiteBuilder(TestIndexOverflowSuite.class);

        VoltProjectBuilder project = new VoltProjectBuilder();
        project.addSchema(TestIndexOverflowSuite.class.getResource("indexoverflowsuite-ddl.sql"));
        project.addPartitionInfo("P1", "ID");
        project.addStmtProcedure("BasicEQParam",           "select * from P1 where ID = ?");
        project.addStmtProcedure("BasicGTParam",           "select * from P1 where ID > ?");
        project.addStmtProcedure("BasicLTParam",           "select * from P1 where ID < ?");

        project.addStmtProcedure("BasicUnderflowEQ",       "select * from P1 where ID = -6000000000");
View Full Code Here

        String schemaPath = schemaFile.getPath();
        schemaPath = URLEncoder.encode(schemaPath, "UTF-8");

        VoltProjectBuilder builder = new VoltProjectBuilder();
        builder.addSchema(schemaPath);
        builder.addPartitionInfo("cjk", "sval1");
        builder.addStmtProcedure("Insert", "insert into cjk values (?,?,?);");
        builder.addStmtProcedure("Select", "select * from cjk;");
        builder.setHTTPDPort(8095);
        boolean success = builder.compile(Configuration.getPathToCatalogForTest("cjk.jar"), 1, 1, 0);
        assertTrue(success);
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.