if (instances.get(datasetInstanceName) != null) {
throw new InstanceConflictException("Dataset instance with name already exists: " + datasetInstanceName);
}
Preconditions.checkArgument(registry.hasType(datasetType), "Dataset type '%s' is not registered", datasetType);
DatasetDefinition def = registry.get(datasetType);
DatasetSpecification spec = def.configure(datasetInstanceName, props);
instances.put(datasetInstanceName, spec);
def.getAdmin(spec, null).create();
instances.put(datasetInstanceName, spec);
LOG.info("Created dataset {} of type {}", datasetInstanceName, datasetType);
}