/** * @return a new spec that is the same as this one, with the original properties set to the provided properties. */ public DatasetSpecification setOriginalProperties(DatasetProperties originalProps) { return setOriginalProperties(originalProps.getProperties()); }
return spec.setOriginalProperties(props);
return spec.setOriginalProperties(props);
public DatasetSpecification reconfigure(String instanceName, DatasetProperties newProperties, DatasetSpecification currentSpec) throws IncompatibleUpdateException { DatasetSpecification spec = AbstractDatasetDefinition .reconfigure(delegate, instanceName, newProperties, currentSpec) .setOriginalProperties(newProperties); if (newProperties.getDescription() != null) { spec = spec.setDescription(newProperties.getDescription()); } return spec; }
public DatasetSpecification configure(String instanceName, DatasetProperties properties) { DatasetSpecification spec = delegate.configure(instanceName, properties); spec = spec.setOriginalProperties(properties); if (properties.getDescription() != null) { spec = spec.setDescription(properties.getDescription()); } return spec; }
public DatasetSpecification configure(String instanceName, DatasetProperties properties) { DatasetSpecification spec = delegate.configure(instanceName, properties); spec = spec.setOriginalProperties(properties); if (properties.getDescription() != null) { spec = spec.setDescription(properties.getDescription()); } return spec; }
public DatasetSpecification reconfigure(String instanceName, DatasetProperties newProperties, DatasetSpecification currentSpec) throws IncompatibleUpdateException { DatasetSpecification spec = AbstractDatasetDefinition .reconfigure(delegate, instanceName, newProperties, currentSpec) .setOriginalProperties(newProperties); if (newProperties.getDescription() != null) { spec = spec.setDescription(newProperties.getDescription()); } return spec; }
@Override public void addInstance(String datasetType, DatasetId datasetInstanceId, DatasetProperties props, @Nullable KerberosPrincipalId ownerPrincipal) throws DatasetManagementException, IOException { if (ownerPrincipal != null) { throw new UnsupportedOperationException("Creating dataset with owner is not supported"); } writeLock.lock(); try { if (instances.contains(datasetInstanceId.getParent(), datasetInstanceId)) { throw new InstanceConflictException(String.format("Dataset instance '%s' already exists.", datasetInstanceId)); } DatasetDefinition def = getDefinitionForType(datasetInstanceId.getParent(), datasetType); if (def == null) { throw new DatasetManagementException( String.format("Dataset type '%s' is neither registered in the '%s' namespace nor in the system namespace", datasetType, datasetInstanceId.getParent())); } DatasetSpecification spec = def.configure(datasetInstanceId.getEntityName(), props); spec = spec.setOriginalProperties(props); if (props.getDescription() != null) { spec = spec.setDescription(props.getDescription()); } def.getAdmin(DatasetContext.from(datasetInstanceId.getNamespace()), spec, null).create(); instances.put(datasetInstanceId.getParent(), datasetInstanceId, spec); publishAudit(datasetInstanceId, AuditType.CREATE); LOG.info("Created dataset {} of type {}", datasetInstanceId, datasetType); } finally { writeLock.unlock(); } }
@Override public void addInstance(String datasetType, DatasetId datasetInstanceId, DatasetProperties props, @Nullable KerberosPrincipalId ownerPrincipal) throws DatasetManagementException, IOException { if (ownerPrincipal != null) { throw new UnsupportedOperationException("Creating dataset with owner is not supported"); } writeLock.lock(); try { if (instances.contains(datasetInstanceId.getParent(), datasetInstanceId)) { throw new InstanceConflictException(String.format("Dataset instance '%s' already exists.", datasetInstanceId)); } DatasetDefinition def = getDefinitionForType(datasetInstanceId.getParent(), datasetType); if (def == null) { throw new DatasetManagementException( String.format("Dataset type '%s' is neither registered in the '%s' namespace nor in the system namespace", datasetType, datasetInstanceId.getParent())); } DatasetSpecification spec = def.configure(datasetInstanceId.getEntityName(), props); spec = spec.setOriginalProperties(props); if (props.getDescription() != null) { spec = spec.setDescription(props.getDescription()); } def.getAdmin(DatasetContext.from(datasetInstanceId.getNamespace()), spec, null).create(); instances.put(datasetInstanceId.getParent(), datasetInstanceId, spec); publishAudit(datasetInstanceId, AuditType.CREATE); LOG.info("Created dataset {} of type {}", datasetInstanceId, datasetType); } finally { writeLock.unlock(); } }
private static DatasetSpecification createType2Spec(String instanceName, String typeName, String description, DatasetProperties properties) { return new TestModule2().createDefinition(typeName).configure(instanceName, properties) .setOriginalProperties(properties).setDescription(description); }
.setOriginalProperties(props); if (props.getDescription() != null) { spec = spec.setDescription(props.getDescription());
.setOriginalProperties(props); if (props.getDescription() != null) { spec = spec.setDescription(props.getDescription());