use of com.thinkbiganalytics.nifi.core.api.metadata.MetadataProvider in project kylo by Teradata.
the class ExecuteSparkJob method fetchDataSet.
private com.thinkbiganalytics.kylo.catalog.rest.model.DataSet fetchDataSet(String id, ProcessSession session, FlowFile flowFile, MetadataProviderService metadataService, List<String> extraJarPaths) {
final MetadataProvider provider = metadataService.getProvider();
final Optional<com.thinkbiganalytics.kylo.catalog.rest.model.DataSet> dataSet;
try {
dataSet = provider.getDataSet(id);
} catch (final Exception e) {
getLog().error("Unable to access data set: {}: {}", new Object[] { id, e }, e);
throw e;
}
if (dataSet.isPresent()) {
if (dataSet.get().getJars() != null) {
extraJarPaths.addAll(dataSet.get().getJars());
}
if (dataSet.get().getDataSource() != null) {
final com.thinkbiganalytics.kylo.catalog.rest.model.DataSource dataSource = dataSet.get().getDataSource();
if (dataSource.getTemplate() != null && dataSource.getTemplate().getJars() != null) {
extraJarPaths.addAll(dataSource.getTemplate().getJars());
}
if (dataSource.getConnector() != null && dataSource.getConnector().getTemplate() != null && dataSource.getConnector().getTemplate().getJars() != null) {
extraJarPaths.addAll(dataSource.getConnector().getTemplate().getJars());
}
}
}
return dataSet != null && dataSet.isPresent() ? dataSet.get() : null;
}
Aggregations