@Override public DatasetCreationResponse create(DatasetId datasetInstanceId, DatasetTypeMeta typeMeta, DatasetProperties props) throws Exception { DatasetType type = client.getDatasetType(typeMeta, null, new ConstantClassLoaderProvider()); if (type == null) { throw new IllegalArgumentException("Dataset type cannot be instantiated for provided type meta: " + typeMeta); } DatasetSpecification spec = type.configure(datasetInstanceId.getEntityName(), props); DatasetAdmin admin = type.getAdmin(DatasetContext.from(datasetInstanceId.getNamespace()), spec); admin.create(); return new DatasetCreationResponse(spec, null); }
DatasetSpecification spec = response.getSpec(); instanceManager.add(namespace, spec); LOG.trace("Added instance metadata for dataset {}", name); LOG.trace("Published metadata for creation of dataset {}", name); SystemMetadata metadata = response.getMetadata(); LOG.trace("Publishing system metadata for creation of dataset {}: {}", name, metadata); publishMetadata(datasetId, metadata);
DatasetSpecification spec = response.getSpec(); instanceManager.add(namespace, spec); LOG.trace("Added instance metadata for dataset {}", name); LOG.trace("Published metadata for creation of dataset {}", name); SystemMetadata metadata = response.getMetadata(); LOG.trace("Publishing system metadata for creation of dataset {}: {}", name, metadata); publishMetadata(datasetId, metadata);
@Override public DatasetCreationResponse create(DatasetId datasetInstanceId, DatasetTypeMeta typeMeta, DatasetProperties props) throws Exception { DatasetType type = client.getDatasetType(typeMeta, null, new ConstantClassLoaderProvider()); if (type == null) { throw new IllegalArgumentException("Dataset type cannot be instantiated for provided type meta: " + typeMeta); } DatasetSpecification spec = type.configure(datasetInstanceId.getEntityName(), props); DatasetAdmin admin = type.getAdmin(DatasetContext.from(datasetInstanceId.getNamespace()), spec); admin.create(); return new DatasetCreationResponse(spec, null); }
DatasetSpecification spec = response.getSpec(); instanceManager.add(instance.getParent(), spec); metaCache.invalidate(instance); metadataPublisher.publish(instance, DatasetInstanceOperation.update(requestingUser, datasetProperties)); publishMetadata(instance, response.getMetadata());
datasetInstanceId, spec, props, typeMeta, type, context, existing != null, ugi); LOG.trace("Computed metadata for dataset {}", datasetInstanceId.getDataset()); return new DatasetCreationResponse(spec, metadata); } catch (Exception e) { if (e instanceof IncompatibleUpdateException) {
DatasetSpecification spec = response.getSpec(); instanceManager.add(instance.getParent(), spec); metaCache.invalidate(instance); metadataPublisher.publish(instance, DatasetInstanceOperation.update(requestingUser, datasetProperties)); publishMetadata(instance, response.getMetadata());
datasetInstanceId, spec, props, typeMeta, type, context, existing != null, ugi); LOG.trace("Computed metadata for dataset {}", datasetInstanceId.getDataset()); return new DatasetCreationResponse(spec, metadata); } catch (Exception e) { if (e instanceof IncompatibleUpdateException) {
@Override public DatasetCreationResponse update(DatasetId datasetInstanceId, DatasetTypeMeta typeMeta, DatasetProperties props, DatasetSpecification existing) throws Exception { DatasetType type = client.getDatasetType(typeMeta, null, new ConstantClassLoaderProvider()); if (type == null) { throw new IllegalArgumentException("Dataset type cannot be instantiated for provided type meta: " + typeMeta); } try { DatasetSpecification spec = type.reconfigure(datasetInstanceId.getEntityName(), props, existing); DatasetAdmin admin = type.getAdmin(DatasetContext.from(datasetInstanceId.getNamespace()), spec); if (admin instanceof Updatable) { ((Updatable) admin).update(existing); } else { admin.create(); } if (spec.getDescription() == null && existing.getDescription() != null) { spec.setDescription(existing.getDescription()); } return new DatasetCreationResponse(spec, null); } catch (IncompatibleUpdateException e) { throw new ConflictException(e.getMessage()); } }
@Override public DatasetCreationResponse update(DatasetId datasetInstanceId, DatasetTypeMeta typeMeta, DatasetProperties props, DatasetSpecification existing) throws Exception { DatasetType type = client.getDatasetType(typeMeta, null, new ConstantClassLoaderProvider()); if (type == null) { throw new IllegalArgumentException("Dataset type cannot be instantiated for provided type meta: " + typeMeta); } try { DatasetSpecification spec = type.reconfigure(datasetInstanceId.getEntityName(), props, existing); DatasetAdmin admin = type.getAdmin(DatasetContext.from(datasetInstanceId.getNamespace()), spec); if (admin instanceof Updatable) { ((Updatable) admin).update(existing); } else { admin.create(); } if (spec.getDescription() == null && existing.getDescription() != null) { spec.setDescription(existing.getDescription()); } return new DatasetCreationResponse(spec, null); } catch (IncompatibleUpdateException e) { throw new ConflictException(e.getMessage()); } }