// don't care if this succeeds or fails.
// calling the new proc before the cat change returns is not guaranteed to work
// we just hope it doesn't crash anything
int x = 3;
SyncCallback cb = new SyncCallback();
client.callProcedure(cb,
org.voltdb.benchmark.tpcc.procedures.InsertOrderLineBatched.class.getSimpleName(),
new long[] {x}, new long[] {x}, x, new long[] {x},
new long[] {x}, new long[] {x}, new TimestampType[] { new TimestampType() }, new long[] {x},
new double[] {x}, new String[] {"a"});
cb.waitForResponse();
// make sure the previous catalog change has completed
client.drain();
assertTrue(callbackSuccess);
// now calling the new proc better work
x = 2;
client.callProcedure(org.voltdb.benchmark.tpcc.procedures.InsertOrderLineBatched.class.getSimpleName(),
new long[] {x}, new long[] {x}, (short)x, new long[] {x},
new long[] {x}, new long[] {x}, new TimestampType[] { new TimestampType() }, new long[] {x},
new double[] {x}, new String[] {"a"});
loadSomeData(client, 50, 5);
assertTrue(callbackSuccess);
// this is a do nothing change... shouldn't affect anything
newCatalogURL = Configuration.getPathToCatalogForTest("catalogupdate-cluster-expanded.jar");
deploymentURL = Configuration.getPathToCatalogForTest("catalogupdate-cluster-expanded.xml");
results = client.updateApplicationCatalog(new File(newCatalogURL), new File(deploymentURL)).getResults();
assertTrue(results.length == 1);
client.drain();
assertTrue(callbackSuccess);
// now calling the new proc better work
x = 4;
client.callProcedure(org.voltdb.benchmark.tpcc.procedures.InsertOrderLineBatched.class.getSimpleName(),
new long[] {x}, new long[] {x}, (short)x, new long[] {x},
new long[] {x}, new long[] {x}, new TimestampType[] { new TimestampType() }, new long[] {x},
new double[] {x}, new String[] {"a"});
loadSomeData(client, 55, 5);
// remove the procedure we just added async
newCatalogURL = Configuration.getPathToCatalogForTest("catalogupdate-cluster-base.jar");
deploymentURL = Configuration.getPathToCatalogForTest("catalogupdate-cluster-base.xml");
callback = new CatTestCallback(ClientResponse.SUCCESS);
client.updateApplicationCatalog(new File(newCatalogURL), new File(deploymentURL));
// don't care if this works now
x = 4;
cb = new SyncCallback();
client.callProcedure(cb,
org.voltdb.benchmark.tpcc.procedures.InsertOrderLineBatched.class.getSimpleName(),
new long[] {x}, new long[] {x}, (short)x, new long[] {x},
new long[] {x}, new long[] {x}, new TimestampType[] { new TimestampType() }, new long[] {x},
new double[] {x}, new String[] {"a"});
cb.waitForResponse();
// make sure the previous catalog change has completed
client.drain();
assertTrue(callbackSuccess);
// now calling the new proc better fail
x = 5;
cb = new SyncCallback();
client.callProcedure(cb,
org.voltdb.benchmark.tpcc.procedures.InsertOrderLineBatched.class.getSimpleName(),
new long[] {x}, new long[] {x}, (short)x, new long[] {x},
new long[] {x}, new long[] {x}, new TimestampType[] { new TimestampType() }, new long[] {x},
new double[] {x}, new String[] {"a"});
cb.waitForResponse();
assertNotSame(cb.getResponse().getStatus(), ClientResponse.SUCCESS);
loadSomeData(client, 60, 5);
// change the insert new order procedure
newCatalogURL = Configuration.getPathToCatalogForTest("catalogupdate-cluster-conflict.jar");