@BeforeSuite
@DeployCluster(numNodes = 1, username = RHQADMIN, password = RHQADMIN_PASSWORD, waitForSchemaAgreement = true)
public void deployCluster() throws Exception {
dateTimeService = new DateTimeService();
Cluster cluster = new ClusterBuilder()
.addContactPoints("127.0.0.1")
.withCredentialsObfuscated(RHQADMIN, RHQADMIN_PASSWORD)
.build();
PoolingOptions poolingOptions = cluster.getConfiguration().getPoolingOptions();
poolingOptions.setCoreConnectionsPerHost(HostDistance.LOCAL, 24);
poolingOptions.setCoreConnectionsPerHost(HostDistance.REMOTE, 24);
poolingOptions.setMaxConnectionsPerHost(HostDistance.LOCAL, 32);
poolingOptions.setMaxConnectionsPerHost(HostDistance.REMOTE, 32);
cluster.register(new Host.StateListener() {
@Override
public void onAdd(Host host) {
log.info("host " + host + " added");
}
@Override
public void onUp(Host host) {
log.info("host " + host + " up");
}
@Override
public void onDown(Host host) {
log.info("host " + host + " down");
}
@Override
public void onRemove(Host host) {
log.info("host " + host + " removed");
}
});
session = cluster.connect("rhq");
storageSession = new StorageSession(session);
}