Package org.voltdb.compiler

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


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

        VoltProjectBuilder builder = new VoltProjectBuilder();
        builder.addLiteralSchema(simpleSchema);
        builder.addPartitionInfo("foo", "bar");
        builder.addStmtProcedure("Insert", "insert into foo values (?, ?);");
        builder.setHTTPDPort(8095);
        boolean success = builder.compile(Configuration.getPathToCatalogForTest("json.jar"));
        assertTrue(success);
View Full Code Here


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

        VoltProjectBuilder builder = new VoltProjectBuilder();
        builder.addSchema(schemaPath);
        builder.addPartitionInfo("foo", "bar");
        builder.addProcedures(DelayProc.class);
        builder.setHTTPDPort(8095);
        boolean success = builder.compile(Configuration.getPathToCatalogForTest("json.jar"));
        assertTrue(success);
View Full Code Here

                + "clm_decimal decimal default null, "
                + "clm_float float default null, "
                + "clm_timestamp timestamp default null, "
                + "PRIMARY KEY(clm_integer) "
                + ");");
        builder.addPartitionInfo("BLAH", "clm_integer");
        builder.addPartitionInfo("JBLAH", "clm_integer");
        boolean success = builder.compile(pathToCatalog, 2, 1, 0);
        assertTrue(success);
        MiscUtils.copyFile(builder.getPathToDeployment(), pathToDeployment);
        Configuration config = new Configuration();
View Full Code Here

                + "clm_float float default null, "
                + "clm_timestamp timestamp default null, "
                + "PRIMARY KEY(clm_integer) "
                + ");");
        builder.addPartitionInfo("BLAH", "clm_integer");
        builder.addPartitionInfo("JBLAH", "clm_integer");
        boolean success = builder.compile(pathToCatalog, 2, 1, 0);
        assertTrue(success);
        MiscUtils.copyFile(builder.getPathToDeployment(), pathToDeployment);
        Configuration config = new Configuration();
        config.m_pathToCatalog = pathToCatalog;
View Full Code Here

            "b varbinary(1) default null, " +
            "PRIMARY KEY(ival));";

        VoltProjectBuilder builder = new VoltProjectBuilder();
        builder.addLiteralSchema(simpleSchema);
        builder.addPartitionInfo("blah", "ival");
        builder.addStmtProcedure("Insert", "insert into blah values (?, ?);", null);
        boolean success = builder.compile(Configuration.getPathToCatalogForTest("hsqldbbin.jar"), 1, 1, 0);
        assertTrue(success);
        MiscUtils.copyFile(builder.getPathToDeployment(), Configuration.getPathToCatalogForTest("hsqldbbin.xml"));
View Full Code Here

            "PRIMARY KEY(ival));\n" +
            "create index idx on blah (ival,s);";

        VoltProjectBuilder builder = new VoltProjectBuilder();
        builder.addLiteralSchema(simpleSchema);
        builder.addPartitionInfo("blah", "ival");
        builder.addStmtProcedure("Insert", "insert into blah values (?, ?, ?, ?);", null);
        builder.addStmtProcedure("Select", "select * from blah;", null);
        builder.addStmtProcedure("Update", "update blah set b = ? where ival = ?", null);
        builder.addStmtProcedure("FindString", "select * from blah where ival = ? and s = ?", null);
        builder.addStmtProcedure("LiteralUpdate", "update blah set b = '0a1A' where ival = 5", null);
View Full Code Here

            "PRIMARY KEY(ival));\n" +
            "create index idx on blah (ival,b);";

        VoltProjectBuilder builder = new VoltProjectBuilder();
        builder.addLiteralSchema(simpleSchema);
        builder.addPartitionInfo("blah", "ival");
        builder.addStmtProcedure("Insert", "insert into blah values (?, ?);", null);
        boolean success = builder.compile(Configuration.getPathToCatalogForTest("binarytest.jar"), 1, 1, 0);
        assertFalse(success);
    }
View Full Code Here

        final int C_ID = 42;

        VoltProjectBuilder builder = new VoltProjectBuilder();
        builder.addSchema(TPCCProjectBuilder.ddlURL);
        for (String pair[] : TPCCProjectBuilder.partitioning) {
            builder.addPartitionInfo(pair[0], pair[1]);
        }
        builder.addStmtProcedure("InsertCustomer", "INSERT INTO CUSTOMER VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);", "CUSTOMER.C_W_ID: 2");
        builder.addStmtProcedure("Fake1", "SELECT C_ID, C_FIRST, C_MIDDLE, C_LAST, C_STREET_1, C_STREET_2, C_CITY, C_STATE, C_ZIP, C_PHONE, C_SINCE, C_CREDIT, C_CREDIT_LIM, C_DISCOUNT, C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_DATA FROM CUSTOMER WHERE C_LAST = ? AND C_D_ID = ? AND C_W_ID = ? ORDER BY C_FIRST;");

        builder.addProcedures(FakeCustomerLookup.class);
View Full Code Here

            // a table that should generate procedures
            // use column names such that lexical order != column order.
            project.addLiteralSchema(
                    "CREATE TABLE p1(b1 INTEGER NOT NULL, a2 VARCHAR(10) NOT NULL, PRIMARY KEY (b1));"
            );
            project.addPartitionInfo("p1", "b1");

            // a partitioned table that should not generate procedures (no pkey)
            project.addLiteralSchema(
                    "CREATE TABLE p2(a1 INTEGER NOT NULL, a2 VARCHAR(10) NOT NULL); " +
                    "CREATE UNIQUE INDEX p2_tree_idx ON p2(a1);"
View Full Code Here

            // a partitioned table that should not generate procedures (no pkey)
            project.addLiteralSchema(
                    "CREATE TABLE p2(a1 INTEGER NOT NULL, a2 VARCHAR(10) NOT NULL); " +
                    "CREATE UNIQUE INDEX p2_tree_idx ON p2(a1);"
            );
            project.addPartitionInfo("p2", "a1");

            // 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);"
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.