Search in sources :

Example 16 with ServerThread

use of org.voltdb.ServerThread in project voltdb by VoltDB.

the class TestJDBCResultSet method startServer.

private static void startServer() throws ClassNotFoundException, SQLException {
    voltDBServer = new ServerThread(testjar, pb.getPathToDeployment(), BackendTarget.NATIVE_EE_JNI);
    voltDBServer.start();
    voltDBServer.waitForInitialization();
    Class.forName("org.voltdb.jdbc.Driver");
    VoltDBConn = DriverManager.getConnection("jdbc:voltdb://localhost:21212");
}
Also used : ServerThread(org.voltdb.ServerThread)

Example 17 with ServerThread

use of org.voltdb.ServerThread in project voltdb by VoltDB.

the class TestJDBCStreamQueries method startServer.

private static void startServer() throws ClassNotFoundException, SQLException {
    server = new ServerThread(testjar, pb.getPathToDeployment(), BackendTarget.NATIVE_EE_JNI);
    server.start();
    server.waitForInitialization();
    Class.forName("org.voltdb.jdbc.Driver");
    if (ClientConfig.ENABLE_SSL_FOR_TEST) {
        conn = DriverManager.getConnection("jdbc:voltdb://localhost:21212?" + JDBCTestCommons.SSL_URL_SUFFIX);
    } else {
        conn = DriverManager.getConnection("jdbc:voltdb://localhost:21212");
    }
}
Also used : ServerThread(org.voltdb.ServerThread)

Example 18 with ServerThread

use of org.voltdb.ServerThread in project voltdb by VoltDB.

the class TestLiveProcedurePartitioningChanges method testSlamming.

public void testSlamming() throws IOException, ProcCallException, InterruptedException {
    String simpleSchema = "create table dummy (" + "sval1 varchar(100) not null, " + "sval2 varchar(100) default 'foo', " + "sval3 varchar(100) default 'bar', " + "PRIMARY KEY(sval1));\n" + "PARTITION TABLE dummy ON COLUMN sval1;";
    DeploymentBuilder deploymentBuilder = new DeploymentBuilder(3, 1, 0);
    deploymentBuilder.setUseDDLSchema(true);
    deploymentBuilder.setEnableCommandLogging(false);
    deploymentBuilder.writeXML(Configuration.getPathToCatalogForTest("slamcatalog.xml"));
    VoltDB.Configuration config = new VoltDB.Configuration();
    config.m_pathToDeployment = Configuration.getPathToCatalogForTest("slamcatalog.xml");
    server = new ServerThread(config);
    server.start();
    server.waitForInitialization();
    Client client = getRandomClient();
    ClientResponse response;
    response = client.callProcedure("@AdHoc", simpleSchema);
    assert (response.getStatus() == ClientResponse.SUCCESS);
    final AtomicBoolean shouldContinue = new AtomicBoolean(true);
    // create a thread to call the proc over and over with different pkeys
    Thread clientThread = new Thread() {

        @Override
        public void run() {
            for (long i = 0; shouldContinue.get(); i++) {
                try {
                    client.callProcedure(PROC_NAME, String.valueOf(i));
                } catch (NoConnectionsException e) {
                    fail();
                } catch (IOException e) {
                    fail();
                } catch (ProcCallException e) {
                    String msg = e.getMessage();
                    e.printStackTrace();
                    assertTrue(msg.contains("is not present") || msg.contains("was not found"));
                }
            }
        }
    };
    clientThread.start();
    // mess up the presence and partitioning of the procedure
    for (int i = 0; i < 50; i++) {
        addProcedure();
        partitionProcedure();
        unpartitionProcedure();
        deleteProcedure();
    }
    shouldContinue.set(false);
    clientThread.join();
    client.close();
    server.shutdown();
}
Also used : ClientResponse(org.voltdb.client.ClientResponse) Configuration(org.voltdb.VoltDB.Configuration) IOException(java.io.IOException) ServerThread(org.voltdb.ServerThread) VoltDB(org.voltdb.VoltDB) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) NoConnectionsException(org.voltdb.client.NoConnectionsException) Configuration(org.voltdb.VoltDB.Configuration) ServerThread(org.voltdb.ServerThread) Client(org.voltdb.client.Client) DeploymentBuilder(org.voltdb.compiler.DeploymentBuilder) ProcCallException(org.voltdb.client.ProcCallException)

Example 19 with ServerThread

use of org.voltdb.ServerThread in project voltdb by VoltDB.

the class TestJDBCMultiConnection method startServer.

private static void startServer() {
    m_server = new ServerThread(m_testJar, m_projectBuilder.getPathToDeployment(), BackendTarget.NATIVE_EE_JNI);
    m_server.start();
    m_server.waitForInitialization();
}
Also used : ServerThread(org.voltdb.ServerThread)

Example 20 with ServerThread

use of org.voltdb.ServerThread in project voltdb by VoltDB.

the class TestJDBCQueries method startServer.

private static void startServer() throws ClassNotFoundException, SQLException {
    server = new ServerThread(testjar, pb.getPathToDeployment(), BackendTarget.NATIVE_EE_JNI);
    server.start();
    server.waitForInitialization();
    Class.forName("org.voltdb.jdbc.Driver");
    if (ClientConfig.ENABLE_SSL_FOR_TEST) {
        conn = DriverManager.getConnection("jdbc:voltdb://localhost:21212?" + JDBCTestCommons.SSL_URL_SUFFIX);
    } else {
        conn = DriverManager.getConnection("jdbc:voltdb://localhost:21212");
    }
}
Also used : ServerThread(org.voltdb.ServerThread)

Aggregations

ServerThread (org.voltdb.ServerThread)36 Configuration (org.voltdb.VoltDB.Configuration)24 VoltDB (org.voltdb.VoltDB)16 File (java.io.File)12 VoltProjectBuilder (org.voltdb.compiler.VoltProjectBuilder)12 VoltTable (org.voltdb.VoltTable)9 Client (org.voltdb.client.Client)7 ClientResponse (org.voltdb.client.ClientResponse)6 IOException (java.io.IOException)5 ClientConfig (org.voltdb.client.ClientConfig)5 DeploymentBuilder (org.voltdb.compiler.DeploymentBuilder)5 BeforeClass (org.junit.BeforeClass)2 ClientResponseImpl (org.voltdb.ClientResponseImpl)2 TableHelper (org.voltdb.TableHelper)2 TPCCProjectBuilder (org.voltdb.benchmark.tpcc.TPCCProjectBuilder)2 ProcCallException (org.voltdb.client.ProcCallException)2 VoltBulkLoader (org.voltdb.client.VoltBulkLoader.VoltBulkLoader)2 CatalogBuilder (org.voltdb.compiler.CatalogBuilder)2 DeploymentType (org.voltdb.compiler.deploymentfile.DeploymentType)2 CommandLine (org.voltdb.utils.CommandLine)2