Package org.voltdb.compiler

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


        cat.deleteOnExit();

        VoltProjectBuilder builder = new VoltProjectBuilder();
        String schema = "create table A (i integer not null, primary key (i));";
        builder.addLiteralSchema(schema);
        builder.addPartitionInfo("A", "i");
        builder.addStmtProcedure("hello", "select * from A where i = ?", "A.i: 0");

        if (!builder.compile(cat.getAbsolutePath())) {
            throw new IOException();
        }
View Full Code Here


                "ID integer not null," +
                "VAL bigint, " +
                "constraint PK_TREE_R primary key (ID)" +
                ");\n"
                );
        builder.addPartitionInfo("FOO", "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

        try {
            project.addLiteralSchema(TestLikeQueries.schema);
        } catch (IOException e) {
            e.printStackTrace();
        }
        project.addPartitionInfo("STRINGS", "ID");

        config = new LocalCluster("sqllike-onesite.jar", 1, 1, 0, BackendTarget.NATIVE_EE_JNI);
        if (!config.compile(project)) fail();
        builder.addServerConfig(config);
View Full Code Here

                "ID integer not null," +
                "VAL bigint, " +
                "constraint PK_TREE_R primary key (ID)" +
                ");\n"
                );
        builder.addPartitionInfo("FOO", "ID");
        builder.setUseDDLSchema(useLiveDDL);
        boolean success = builder.compile(m_pathToCatalog, 2, 1, 0);
        assertTrue("Schema compilation failed", success);
        MiscUtils.copyFile(builder.getPathToDeployment(), m_pathToDeployment);
View Full Code Here

                "ID integer not null," +
                "VAL bigint, " +
                "constraint PK_TREE_R primary key (ID)" +
                ");\n"
                );
        builder.addPartitionInfo("BAZ", "ID");
        builder.setUseDDLSchema(useLiveDDL);
        builder.setDeadHostTimeout(6);
        success = builder.compile(m_pathToOtherCatalog, 2, 1, 0);
        assertTrue("2nd schema compilation failed", success);
        MiscUtils.copyFile(builder.getPathToDeployment(), m_pathToOtherDeployment);
View Full Code Here

                    "PRIMARY KEY(ival));";

            VoltProjectBuilder builder = new VoltProjectBuilder();
            builder.addLiteralSchema(simpleSchema);
            builder.addStmtProcedure("Insert", "insert into blah values (?);", null);
            builder.addPartitionInfo("blah", "ival");
            // this is a NOOP as builder will only honor it if there is
            // and accompanying call to builder.addExport
            builder.setTableAsExportOnly("blah");

            LocalCluster cluster = new LocalCluster("latencycheck.jar",
View Full Code Here

            "  PRIMARY KEY (ID)\n" +
            ");";

        VoltProjectBuilder builder = new VoltProjectBuilder();
        builder.addLiteralSchema(simpleSchema);
        builder.addPartitionInfo("P1", "ID");
        builder.addStmtProcedure("nocrash", "select * from P1 where ID = 6000000000;");
        builder.addStmtProcedure("crash", "UPDATE P1 SET BIG = BIG + 4 WHERE P1.ID>= 5200704751286217677");
        builder.addStmtProcedure("crash2", "SELECT * FROM P1 WHERE P1.ID>-6611959682909750107");
        builder.addStmtProcedure("crash3", "SELECT * FROM P1 INNER JOIN R1 ON P1.ID = R1.BIG");
        builder.addStmtProcedure("crash4", "SELECT * FROM P1 WHERE P1.ID = 5 AND P1.TINY > -2000;");
View Full Code Here

        String pathToCatalog = Configuration.getPathToCatalogForTest("adhoc_like.jar");
        String pathToDeployment = Configuration.getPathToCatalogForTest("adhoc_like.xml");

        VoltProjectBuilder builder = new VoltProjectBuilder();
        builder.addLiteralSchema(schema);
        builder.addPartitionInfo("STRINGS", "ID");
        builder.addStmtProcedure("Insert", "insert into strings values (?, ?, ?);", null);
        builder.addStmtProcedure("SelectLike", "select * from strings where  val like ?;");
        builder.addStmtProcedure("SelectNotLike", "select * from strings where  val not like ?;");
        boolean success = builder.compile(pathToCatalog, 2, 1, 0);
        assertTrue("Insert compilation failed", success);
View Full Code Here

                "ID integer not null," +
                "VAL bigint, " +
                "constraint PK_TREE_R primary key (ID)" +
                ");\n"
                );
        builder.addPartitionInfo("FOO", "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

                "column2 bigint not null," +
                "constraint idx_table3_TREE_pk primary key (column1, column2));\n";

        VoltProjectBuilder builder = new VoltProjectBuilder();
        builder.addLiteralSchema(simpleSchema);
        builder.addPartitionInfo("table1", "column1");
        builder.addPartitionInfo("table2", "column1");
        builder.addPartitionInfo("table3", "column1");
        builder.addStmtProcedure("SelectT1", "select * from table1 where column1 = ? and column2 = ?;", "table1.column1:0");
        builder.addStmtProcedure("SelectT2", "select * from table2 where column1 = ? and column2 = ?;", "table1.column1:0");
        builder.addStmtProcedure("SelectT3", "select * from table3 where column1 = ? and column2 = ?;", "table1.column1:0");
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.