}
@Override
public OperationResult<SchemaChangeResult> createKeyspace(final Properties props) throws ConnectionException {
if (props.containsKey("name") && !props.get("name").equals(getKeyspaceName())) {
throw new BadRequestException(
String.format("'name' attribute must match keyspace name. Expected '%s' but got '%s'",
getKeyspaceName(), props.get("name")));
}
final KsDef ksDef;
try {
ksDef = ThriftUtils.getThriftObjectFromProperties(KsDef.class, props);
} catch (Exception e) {
throw new BadRequestException("Unable to convert props to keyspace definition");
}
return internalCreateKeyspace(ksDef);
}