use of org.voltdb.sysprocs.UpdateCore in project voltdb by VoltDB.
the class TestNTProcs method testUAC.
public void testUAC() throws Exception {
String pathToCatalog = Configuration.getPathToCatalogForTest("adhocddl.jar");
String pathToDeployment = Configuration.getPathToCatalogForTest("adhocddl.xml");
VoltProjectBuilder builder = new VoltProjectBuilder();
builder.addLiteralSchema("--dont care");
builder.setUseDDLSchema(true);
boolean success = builder.compile(pathToCatalog, 2, 1, 0);
assertTrue("Schema compilation failed", success);
MiscUtils.copyFile(builder.getPathToDeployment(), pathToDeployment);
VoltDB.Configuration config = new VoltDB.Configuration();
config.m_pathToCatalog = pathToCatalog;
config.m_pathToDeployment = pathToDeployment;
ServerThread localServer = new ServerThread(config);
localServer.start();
localServer.waitForInitialization();
Client client = ClientFactory.createClient();
client.createConnection("localhost");
ClientResponseImpl response = (ClientResponseImpl) client.callProcedure("@AdHoc", "create table blah (pkey integer not null, strval varchar(200), PRIMARY KEY(pkey));");
assertEquals(ClientResponse.SUCCESS, response.getStatus());
// CHECK STATS
VoltTable statsT = getStats(client, "PROCEDURE");
System.out.println("STATS: " + statsT.toFormattedString());
assertTrue(VoltTableUtil.tableContainsString(statsT, "UpdateCore", true));
Map<String, Long> stats = aggregateProcRow(client, UpdateCore.class.getName());
assertEquals(1, stats.get("INVOCATIONS").longValue());
localServer.shutdown();
localServer.join();
}
Aggregations