Search in sources :

Example 86 with VoltProjectBuilder

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

the class TestStartWithSchema method setUp.

@Before
public void setUp() throws Exception {
    // Creates a cluster on the local machine using NewCLI, staging the specified schema.
    // Catalog compilation is taken care of by VoltDB itself - no need to do so explicitly.
    cluster = new LocalCluster(schema, null, siteCount, hostCount, kfactor, clusterID, BackendTarget.NATIVE_EE_JNI, FailureState.ALL_RUNNING, false, false, null);
    cluster.setHasLocalServer(false);
    cluster.overrideAnyRequestForValgrind();
    VoltProjectBuilder builder = new VoltProjectBuilder();
    builder.setUseDDLSchema(true);
    cluster.compileDeploymentOnly(builder);
    new File(builder.getPathToDeployment()).deleteOnExit();
    // positive tests should succeed; negative tests look for the exception
    cluster.setExpectedToCrash(false);
}
Also used : LocalCluster(org.voltdb.regressionsuites.LocalCluster) VoltProjectBuilder(org.voltdb.compiler.VoltProjectBuilder) VoltFile(org.voltdb.utils.VoltFile) File(java.io.File) Before(org.junit.Before)

Example 87 with VoltProjectBuilder

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

the class TestStopNode method getBuilderForTest.

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

Example 88 with VoltProjectBuilder

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

the class TestSqlLikeRegressionSuite method suite.

public static junit.framework.Test suite() {
    VoltServerConfig config = null;
    MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestSqlLikeRegressionSuite.class);
    VoltProjectBuilder project = new VoltProjectBuilder();
    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);
    config = new LocalCluster("sqllike-twosites.jar", 2, 1, 0, BackendTarget.NATIVE_EE_JNI);
    if (!config.compile(project))
        fail();
    builder.addServerConfig(config);
    // This config works for TestSqlAggregateSuite, but not here? Don't know why.
    // It seems to get confused in leader election and start down some unwanted RECOVERY code path.
    // Any multi-host config, even single site per host seems to be hanging.
    // Disabling for now.
    // config = new LocalCluster("sqllike-twosites.jar", 2, 3, 1, BackendTarget.NATIVE_EE_JNI);
    // if (!config.compile(project)) fail();
    // builder.addServerConfig(config);
    config = new LocalCluster("sqllike-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) IOException(java.io.IOException)

Example 89 with VoltProjectBuilder

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

the class TestSqlLogicOperatorsSuite method suite.

public static junit.framework.Test suite() {
    VoltServerConfig config = null;
    MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestSqlLogicOperatorsSuite.class);
    VoltProjectBuilder project = new VoltProjectBuilder();
    project.addSchema(Insert.class.getResource("sql-update-ddl.sql"));
    project.addProcedures(PROCEDURES);
    config = new LocalCluster("sqllogic-onesite.jar", 1, 1, 0, BackendTarget.NATIVE_EE_JNI);
    if (!config.compile(project))
        fail();
    builder.addServerConfig(config);
    config = new LocalCluster("sqllogic-hsql.jar", 1, 1, 0, BackendTarget.HSQLDB_BACKEND);
    if (!config.compile(project))
        fail();
    builder.addServerConfig(config);
    config = new LocalCluster("sqllogic-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 90 with VoltProjectBuilder

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

the class TestStopNode2NK1PartitionDetectionOff method suite.

public static Test suite() throws IOException {
    // the suite made here will all be using the tests from this class
    MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestStopNode2NK1PartitionDetectionOff.class);
    // build up a project builder for the workload
    VoltProjectBuilder project = getBuilderForTest();
    boolean success;
    //Lets tolerate 3 node failures.
    if (!MiscUtils.isPro()) {
        kfactor = 0;
    }
    m_config = new LocalCluster("decimal-default.jar", 4, 2, kfactor, BackendTarget.NATIVE_EE_JNI);
    m_config.setHasLocalServer(true);
    success = m_config.compile(project);
    assertTrue(success);
    // add this config to the set of tests to run
    builder.addServerConfig(m_config);
    return builder;
}
Also used : VoltProjectBuilder(org.voltdb.compiler.VoltProjectBuilder)

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