use of org.apache.gobblin.runtime.api.JobTemplate in project incubator-gobblin by apache.
the class InheritingJobTemplate method getResolvedConfigHelper.
private Config getResolvedConfigHelper(Config userConfig, Set<JobTemplate> alreadyLoadedTemplates) throws SpecNotFoundException, TemplateException {
Config config = getLocallyResolvedConfig(userConfig);
for (JobTemplate template : Lists.reverse(this.superTemplates)) {
if (!alreadyLoadedTemplates.contains(template)) {
alreadyLoadedTemplates.add(template);
Config fallback = template instanceof InheritingJobTemplate ? ((InheritingJobTemplate) template).getResolvedConfigHelper(config, alreadyLoadedTemplates) : template.getResolvedConfig(config);
config = config.withFallback(fallback);
}
}
return config;
}
use of org.apache.gobblin.runtime.api.JobTemplate in project incubator-gobblin by apache.
the class ResolvedJobSpec method resolveConfig.
private static Config resolveConfig(JobSpec jobSpec, JobCatalog catalog) throws SpecNotFoundException, JobTemplate.TemplateException {
Optional<URI> templateURIOpt = jobSpec.getTemplateURI();
if (templateURIOpt.isPresent()) {
JobCatalogWithTemplates catalogWithTemplates = new PackagedTemplatesJobCatalogDecorator(catalog);
JobTemplate template = catalogWithTemplates.getTemplate(templateURIOpt.get());
return template.getResolvedConfig(jobSpec.getConfig()).resolve();
} else {
return jobSpec.getConfig().resolve();
}
}
Aggregations