LOG.info("Creating dataset instance {}, type meta: {}, props: {}", name, typeMetaHeader, propsHeader);
DatasetProperties props = GSON.fromJson(propsHeader, DatasetProperties.class);
DatasetTypeMeta typeMeta = GSON.fromJson(typeMetaHeader, DatasetTypeMeta.class);
DatasetType type = dsFramework.getDatasetType(typeMeta, null);
if (type == null) {
String msg = String.format("Cannot instantiate dataset type using provided type meta: %s", typeMeta);
LOG.error(msg);
responder.sendError(HttpResponseStatus.BAD_REQUEST, msg);
return;
}
DatasetSpecification spec = type.configure(name, props);
DatasetAdmin admin = type.getAdmin(spec);
admin.create();
responder.sendJson(HttpResponseStatus.OK, spec);
}