int numberOfNodes) {
if (clusterExists(client, clusterIdentifier)) {
LOG.info("Cluster " + clusterIdentifier + " is available");
return;
}
CreateClusterRequest createClusterRequest = new CreateClusterRequest();
createClusterRequest.setClusterIdentifier(clusterIdentifier);
createClusterRequest.setMasterUsername(masterUsername);
createClusterRequest.setMasterUserPassword(masterUserPassword);
createClusterRequest.setNodeType(clusterType);
createClusterRequest.setNumberOfNodes(numberOfNodes);
createClusterRequest.setDBName(databaseName);
client.createCluster(createClusterRequest);
LOG.info("Created cluster " + clusterIdentifier);
String state = null;
while (!(state = clusterState(client, clusterIdentifier)).equals("available")) {
try {