use of org.voltdb.client.SyncCallback in project voltdb by VoltDB.
the class TestUpdateDeployment method testUpdateSchemaModificationIsBlacklisted.
public void testUpdateSchemaModificationIsBlacklisted() throws Exception {
System.out.println("\n\n-----\n testUpdateSchemaModificationIsBlacklisted \n-----\n\n");
Client client = getClient();
loadSomeData(client, 0, 10);
client.drain();
assertTrue(callbackSuccess);
String deploymentURL = Configuration.getPathToCatalogForTest("catalogupdate-cluster-change_schema_update.xml");
// Try to change the schem setting
SyncCallback cb = new SyncCallback();
client.updateApplicationCatalog(cb, null, new File(deploymentURL));
cb.waitForResponse();
assertEquals(ClientResponse.GRACEFUL_FAILURE, cb.getResponse().getStatus());
System.out.println(cb.getResponse().getStatusString());
assertTrue(cb.getResponse().getStatusString().contains("May not dynamically modify"));
}
use of org.voltdb.client.SyncCallback in project voltdb by VoltDB.
the class TestUpdateDeployment method testUpdateSecurityNoUsers.
public void testUpdateSecurityNoUsers() throws Exception {
System.out.println("\n\n-----\n testUpdateSecurityNoUsers \n-----\n\n");
Client client = getClient();
loadSomeData(client, 0, 10);
client.drain();
assertTrue(callbackSuccess);
String deploymentURL = Configuration.getPathToCatalogForTest("catalogupdate-security-no-users.xml");
// Try to change the schem setting
SyncCallback cb = new SyncCallback();
client.updateApplicationCatalog(cb, null, new File(deploymentURL));
cb.waitForResponse();
assertEquals(ClientResponse.GRACEFUL_FAILURE, cb.getResponse().getStatus());
System.out.println(cb.getResponse().getStatusString());
assertTrue(cb.getResponse().getStatusString().contains("Unable to update"));
}
use of org.voltdb.client.SyncCallback in project voltdb by VoltDB.
the class TestUpdateDeployment method testUpdateSecurityBadUsername.
public void testUpdateSecurityBadUsername() throws Exception {
System.out.println("\n\n-----\n testUpdateSecurityBadUsername \n-----\n\n");
Client client = getClient();
loadSomeData(client, 0, 10);
client.drain();
assertTrue(callbackSuccess);
String deploymentURL = Configuration.getPathToCatalogForTest("catalogupdate-bad-username.xml");
// Try to change the schem setting
SyncCallback cb = new SyncCallback();
client.updateApplicationCatalog(cb, null, new File(deploymentURL));
cb.waitForResponse();
assertEquals(ClientResponse.GRACEFUL_FAILURE, cb.getResponse().getStatus());
System.out.println(cb.getResponse().getStatusString());
assertTrue(cb.getResponse().getStatusString().contains("Unable to update"));
}
use of org.voltdb.client.SyncCallback in project voltdb by VoltDB.
the class TestUpdateDeployment method testConsecutiveCatalogDeploymentRace.
public void testConsecutiveCatalogDeploymentRace() throws Exception {
System.out.println("\n\n-----\n testConsecutiveCatalogDeploymentRace \n-----\n\n");
Client client = getClient();
loadSomeData(client, 0, 10);
client.drain();
assertTrue(callbackSuccess);
String newCatalogURL = Configuration.getPathToCatalogForTest("catalogupdate-cluster-addtable.jar");
String deploymentURL = Configuration.getPathToCatalogForTest("catalogupdate-cluster-addtable.xml");
// Asynchronously attempt consecutive catalog update and deployment update
client.updateApplicationCatalog(new CatTestCallback(ClientResponse.SUCCESS), new File(newCatalogURL), null);
// Then, update the users in the deployment
SyncCallback cb2 = new SyncCallback();
client.updateApplicationCatalog(cb2, null, new File(deploymentURL));
cb2.waitForResponse();
assertEquals(ClientResponse.USER_ABORT, cb2.getResponse().getStatus());
assertTrue(cb2.getResponse().getStatusString().contains("Invalid catalog update"));
// Verify the heartbeat timeout change didn't take
Client client3 = getClient();
boolean found = false;
int timeout = -1;
VoltTable result = client3.callProcedure("@SystemInformation", "DEPLOYMENT").getResults()[0];
while (result.advanceRow()) {
if (result.getString("PROPERTY").equalsIgnoreCase("heartbeattimeout")) {
found = true;
timeout = Integer.valueOf(result.getString("VALUE"));
}
}
assertTrue(found);
assertEquals(org.voltcore.common.Constants.DEFAULT_HEARTBEAT_TIMEOUT_SECONDS, timeout);
// Verify that table A exists
ClientResponse response = client3.callProcedure("@AdHoc", "insert into NEWTABLE values (100);");
assertEquals(ClientResponse.SUCCESS, response.getStatus());
}
use of org.voltdb.client.SyncCallback in project voltdb by VoltDB.
the class TestLimitOffsetSuite method load.
private static void load(Client client) throws NoConnectionsException, IOException, InterruptedException {
for (int i = 0; i < 10; i++) {
SyncCallback cb = new SyncCallback();
client.callProcedure(cb, "InsertA", i, i);
cb.waitForResponse();
assertEquals(1, cb.getResponse().getResults()[0].asScalarLong());
}
for (int i = 0; i < 10; i++) {
SyncCallback cb = new SyncCallback();
client.callProcedure(cb, "InsertB", i, i);
cb.waitForResponse();
assertEquals(1, cb.getResponse().getResults()[0].asScalarLong());
}
}
Aggregations