Search in sources :

Example 81 with VoltProjectBuilder

use of org.voltdb.compiler.VoltProjectBuilder in project voltdb by VoltDB.

the class TestShutdown method getBuilderForTest.

static VoltProjectBuilder getBuilderForTest() throws IOException {
    VoltProjectBuilder builder = new VoltProjectBuilder();
    builder.addLiteralSchema("");
    return builder;
}
Also used : VoltProjectBuilder(org.voltdb.compiler.VoltProjectBuilder)

Example 82 with VoltProjectBuilder

use of org.voltdb.compiler.VoltProjectBuilder in project voltdb by VoltDB.

the class TestShutdownSaveNoCommandLog method suite.

public static junit.framework.Test suite() throws Exception {
    final MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestShutdownSaveNoCommandLog.class);
    Map<String, String> additionalEnv = new HashMap<String, String>();
    VoltProjectBuilder project = new VoltProjectBuilder();
    project.addSchema(ArbitraryDurationProc.class.getResource("clientfeatures.sql"));
    project.addProcedures(ArbitraryDurationProc.class);
    project.setUseDDLSchema(true);
    project.addPartitionInfo("indexme", "pkey");
    LocalCluster config = new LocalCluster("prepare_shutdown_importer.jar", 4, HOST_COUNT, 0, BackendTarget.NATIVE_EE_JNI, LocalCluster.FailureState.ALL_RUNNING, true, false, additionalEnv);
    config.setHasLocalServer(false);
    boolean compile = config.compileWithAdminMode(project, -1, false);
    assertTrue(compile);
    builder.addServerConfig(config);
    return builder;
}
Also used : HashMap(java.util.HashMap) VoltProjectBuilder(org.voltdb.compiler.VoltProjectBuilder) ArbitraryDurationProc(org.voltdb.client.ArbitraryDurationProc)

Example 83 with VoltProjectBuilder

use of org.voltdb.compiler.VoltProjectBuilder in project voltdb by VoltDB.

the class TestSqlAggregateSuite method suite.

public static junit.framework.Test suite() {
    VoltServerConfig config = null;
    MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestSqlAggregateSuite.class);
    VoltProjectBuilder project = new VoltProjectBuilder();
    project.addSchema(Insert.class.getResource("aggregate-sql-ddl.sql"));
    project.addPartitionInfo("P1", "ID");
    project.addProcedures(PROCEDURES);
    config = new LocalCluster("sqlaggregate-onesite.jar", 1, 1, 0, BackendTarget.NATIVE_EE_JNI);
    if (!config.compile(project))
        fail();
    builder.addServerConfig(config);
    config = new LocalCluster("sqlaggregate-twosites.jar", 2, 1, 0, BackendTarget.NATIVE_EE_JNI);
    if (!config.compile(project))
        fail();
    builder.addServerConfig(config);
    config = new LocalCluster("sqlaggregate-twosites.jar", 2, 3, 1, BackendTarget.NATIVE_EE_JNI);
    if (!config.compile(project))
        fail();
    builder.addServerConfig(config);
    // HSQL backend testing fails a few cases,
    // probably due to differences in null representation -- it doesn't support MIN_VALUE as null
    // These specific cases are qualified with if ( ! isHSQL()).
    config = new LocalCluster("sqlaggregate-hsql.jar", 1, 1, 0, BackendTarget.HSQLDB_BACKEND);
    if (!config.compile(project))
        fail();
    builder.addServerConfig(config);
    return builder;
}
Also used : VoltProjectBuilder(org.voltdb.compiler.VoltProjectBuilder) Insert(org.voltdb_testprocs.regressionsuites.aggregates.Insert)

Example 84 with VoltProjectBuilder

use of org.voltdb.compiler.VoltProjectBuilder in project voltdb by VoltDB.

the class TestSqlDeleteSuite method suite.

public static junit.framework.Test suite() {
    VoltServerConfig config = null;
    MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestSqlDeleteSuite.class);
    VoltProjectBuilder project = new VoltProjectBuilder();
    project.addSchema(Insert.class.getResource("sql-update-ddl.sql"));
    project.addProcedures(PROCEDURES);
    config = new LocalCluster("sqldelete-onesite.jar", 1, 1, 0, BackendTarget.NATIVE_EE_JNI);
    if (!config.compile(project))
        fail();
    builder.addServerConfig(config);
    config = new LocalCluster("sqldelete-hsql.jar", 1, 1, 0, BackendTarget.HSQLDB_BACKEND);
    if (!config.compile(project))
        fail();
    builder.addServerConfig(config);
    // Cluster
    config = new LocalCluster("sqldelete-cluster.jar", 2, 3, 1, BackendTarget.NATIVE_EE_JNI);
    if (!config.compile(project))
        fail();
    builder.addServerConfig(config);
    return builder;
}
Also used : VoltProjectBuilder(org.voltdb.compiler.VoltProjectBuilder) Insert(org.voltdb_testprocs.regressionsuites.fixedsql.Insert)

Example 85 with VoltProjectBuilder

use of org.voltdb.compiler.VoltProjectBuilder in project voltdb by VoltDB.

the class TestSqlInsertSuite method suite.

public static junit.framework.Test suite() {
    VoltServerConfig config = null;
    MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestSqlInsertSuite.class);
    VoltProjectBuilder project = new VoltProjectBuilder();
    final String literalSchema = "CREATE TABLE P1 ( " + "ccc bigint default 10 not null, " + "bbb bigint default 11, " + "aaa bigint default 12, " + "zzz bigint not null, " + "yyy bigint default 14, " + // default null
    "xxx bigint " + ");" + "PARTITION TABLE P1 ON COLUMN ccc;" + "CREATE INDEX IDX_P1 ON P1(1/ccc);" + "" + "CREATE TABLE R1 ( " + "ccc bigint default 10 not null, " + "bbb bigint default 11, " + "aaa bigint default 12, " + "zzz bigint not null, " + "yyy bigint default 14, " + // default null
    "xxx bigint " + ");" + "" + "CREATE TABLE R2 ( " + "ccc bigint default 10 not null, " + "bbb bigint default 11, " + "aaa bigint default 12, " + "zzz bigint not null, " + "yyy bigint default 14, " + // default null
    "xxx bigint " + ");" + "";
    try {
        project.addLiteralSchema(literalSchema);
    } catch (IOException e) {
        assertFalse(true);
    }
    boolean success;
    config = new LocalCluster("sqlinsert-onesite.jar", 2, 1, 0, BackendTarget.NATIVE_EE_JNI);
    success = config.compile(project);
    assert (success);
    builder.addServerConfig(config);
    // Cluster
    config = new LocalCluster("sqlinsert-cluster.jar", 2, 3, 1, BackendTarget.NATIVE_EE_JNI);
    success = config.compile(project);
    assert (success);
    builder.addServerConfig(config);
    return builder;
}
Also used : VoltProjectBuilder(org.voltdb.compiler.VoltProjectBuilder) IOException(java.io.IOException)

Aggregations

VoltProjectBuilder (org.voltdb.compiler.VoltProjectBuilder)269 Configuration (org.voltdb.VoltDB.Configuration)89 IOException (java.io.IOException)49 Test (org.junit.Test)45 File (java.io.File)40 ProcCallException (org.voltdb.client.ProcCallException)38 ClientResponse (org.voltdb.client.ClientResponse)37 VoltDB (org.voltdb.VoltDB)22 LocalCluster (org.voltdb.regressionsuites.LocalCluster)18 Client (org.voltdb.client.Client)17 Before (org.junit.Before)14 HashMap (java.util.HashMap)13 VoltTable (org.voltdb.VoltTable)13 ServerThread (org.voltdb.ServerThread)12 InMemoryJarfile (org.voltdb.utils.InMemoryJarfile)12 VoltCompiler (org.voltdb.compiler.VoltCompiler)11 HttpResponse (org.apache.http.HttpResponse)10 BeforeClass (org.junit.BeforeClass)8 ClientConfig (org.voltdb.client.ClientConfig)7 UserInfo (org.voltdb.compiler.VoltProjectBuilder.UserInfo)7