System.out.println("Starting testTPCC - Physical Recovery");
VoltTable results[] = null;
ClientResponse cresponse = null;
Client client = this.getClient();
CatalogContext cc = this.getCatalogContext();
// Load database
try{
initializeTPCCDatabase(cc, client, false);
}
catch(Exception e){
e.printStackTrace();
}
final String MOCK_ARGS[] = { "HOST=localhost", "NUMCLIENTS=1",
// XXX HACK to find catalog jar
"CATALOG=" + "./obj/release/testobjects/" + projectJAR, "" };
MOCK_ARGS[MOCK_ARGS.length - 1] = HStoreConstants.BENCHMARK_PARAM_PREFIX;
TPCCClient tpccClient = new TPCCClient(MOCK_ARGS);
// Run transactions
long k_itr = 0;
long numTransactions = NUM_TRANSACTIONS;
long period = numTransactions / 10;
for (k_itr = 0; k_itr < numTransactions; k_itr++) {
boolean response = tpccClient.runOnce();
assertEquals(response, true);
if (k_itr % period == 0)
System.out.println(String.format("Transactions Processed: %6d / %d", k_itr, numTransactions));
}
// Statistics
results = client.callProcedure("@Statistics", "table", 0).getResults();
System.out.println("@Statistics before RESTART :");
System.out.println(results[0]);
// Kill and restart all the execution sites.
m_config.shutDown();
m_config.startUp();
client = getClient();
results = client.callProcedure("@Statistics", "table", 0).getResults();
System.out.println("@Statistics after PHYSICAL restore :");
System.out.println(results[0]);
}