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");
}
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");
}
}
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();
}
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();
}
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");
}
}
Aggregations