public void process(ApplicationSpecLocation input) throws Exception {
// create dataset instances
ApplicationSpecification specification = input.getSpecification();
for (Map.Entry<String, DatasetCreationSpec> instanceEntry : specification.getDatasets().entrySet()) {
String instanceName = instanceEntry.getKey();
DatasetCreationSpec instanceSpec = instanceEntry.getValue();
try {
if (!datasetFramework.hasInstance(instanceName)) {
datasetFramework.addInstance(instanceSpec.getTypeName(), instanceName, instanceSpec.getProperties());
}
} catch (InstanceConflictException e) {
// NO-OP: Instance is simply already created, possibly by an older version of this app OR a different app
// TODO: verify that the created instance is from this app
LOG.warn("Couldn't create dataset instance '" + instanceName + "' of type '" + instanceSpec.getTypeName(), e);
}
}
// Emit the input to next stage.
emit(input);