Search in sources :

Example 36 with ServerThread

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

the class TestCSVLoader method startDatabase.

@BeforeClass
public static void startDatabase() throws Exception {
    prepare();
    String pathToCatalog = Configuration.getPathToCatalogForTest("csv.jar");
    String pathToDeployment = Configuration.getPathToCatalogForTest("csv.xml");
    VoltProjectBuilder builder = new VoltProjectBuilder();
    builder.addLiteralSchema("create table BLAH (" + "clm_integer integer not null, " + "clm_tinyint tinyint default 0, " + "clm_smallint smallint default 0, " + "clm_bigint bigint default 0, " + "clm_string varchar(20) default null, " + "clm_decimal decimal default null, " + "clm_float float default null, " + "clm_timestamp timestamp default null, " + "clm_point geography_point default null, " + "clm_geography geography default null, " + "PRIMARY KEY(clm_integer) " + ");");
    builder.addPartitionInfo("BLAH", "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;
    config.m_pathToDeployment = pathToDeployment;
    localServer = new ServerThread(config);
    client = null;
    localServer.start();
    localServer.waitForInitialization();
    client = ClientFactory.createClient(new ClientConfig());
    client.createConnection("localhost");
}
Also used : Configuration(org.voltdb.VoltDB.Configuration) VoltProjectBuilder(org.voltdb.compiler.VoltProjectBuilder) ServerThread(org.voltdb.ServerThread) ClientConfig(org.voltdb.client.ClientConfig) BeforeClass(org.junit.BeforeClass)

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