// Send index command to one node. That node will distribute the command to other nodes.
String response = sendInfoCommand(policy, sb.toString());
if (response.equalsIgnoreCase("OK")) {
// Return task that could optionally be polled for completion.
return new IndexTask(cluster, namespace, indexName);
}
if (response.equals("FAIL:208:ERR FOUND")) {
// Index has already been created. Do not need to poll for completion.
return new IndexTask();
}
throw new AerospikeException("Create index failed: " + response);
}