private Config getRawTemplateConfigHelper(Set<JobTemplate> alreadyInheritedTemplates) throws SpecNotFoundException, TemplateException { Config rawTemplate = getLocalRawTemplate(); for (JobTemplate template : Lists.reverse(this.superTemplates)) { if (!alreadyInheritedTemplates.contains(template)) { alreadyInheritedTemplates.add(template); Config thisFallback = template instanceof InheritingJobTemplate ? ((InheritingJobTemplate) template).getRawTemplateConfigHelper(alreadyInheritedTemplates) : template.getRawTemplateConfig(); rawTemplate = rawTemplate.withFallback(thisFallback); } } return rawTemplate; }
String templateId = uri.substring(uri.length() - 1); for (int j = 0; j < 2; j++) { Config jobTemplateConfig = jobTemplates.get(i).getRawTemplateConfig(); String suffix = templateId + Integer.toString(j + 1); Assert.assertEquals(jobTemplateConfig.getString("key" + suffix), "val" + suffix);
for (JobTemplate jobTemplate: this.jobTemplates) { String jobSpecUri = Files.getNameWithoutExtension(new Path(jobTemplate.getUri()).getName()); jobExecutionPlans.add(new JobExecutionPlan(JobSpec.builder(jobSpecUri).withConfig(jobTemplate.getRawTemplateConfig()). withVersion("1").withTemplate(jobTemplate.getUri()).build(), specExecutor));
private Config getRawTemplateConfigHelper(Set<JobTemplate> alreadyInheritedTemplates) throws SpecNotFoundException, TemplateException { Config rawTemplate = getLocalRawTemplate(); for (JobTemplate template : Lists.reverse(this.superTemplates)) { if (!alreadyInheritedTemplates.contains(template)) { alreadyInheritedTemplates.add(template); Config thisFallback = template instanceof InheritingJobTemplate ? ((InheritingJobTemplate) template).getRawTemplateConfigHelper(alreadyInheritedTemplates) : template.getRawTemplateConfig(); rawTemplate = rawTemplate.withFallback(thisFallback); } } return rawTemplate; }