@Test public void clonesBaseRoleConfigForHostGroups() { HostgroupView master = new HostgroupView("master", 1, InstanceGroupType.GATEWAY, 1); HostgroupView worker = new HostgroupView("worker", 2, InstanceGroupType.CORE, 2); HostgroupView compute = new HostgroupView("compute", 3, InstanceGroupType.CORE, 2); setup("input/clouderamanager-3hg-same-DN-role.bp", Builder.builder().withHostgroupViews(Set.of(master, worker, compute))); underTest.process(templateProcessor, templatePreparator); Map<String, List<ApiClusterTemplateConfig>> roleConfigs = mapRoleConfigs(); assertNull(roleConfigs.get("hdfs-DATANODE-BASE")); assertEquals(List.of(config("dfs_data_dir_list", "/hadoopfs/fs1/datanode,/hadoopfs/fs2/datanode")), roleConfigs.get("hdfs-DATANODE-worker")); assertEquals(List.of(config("dfs_data_dir_list", "/hadoopfs/fs1/datanode,/hadoopfs/fs2/datanode,/hadoopfs/fs3/datanode")), roleConfigs.get("hdfs-DATANODE-compute")); }
public void process(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) { if (!getHostTemplates(templateProcessor).isEmpty()) { updateConfigsInTemplate(templateProcessor, generateConfigs(templateProcessor, source)); } }
CmHostGroupRoleConfigProviderProcessor { public void process(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) { if (!getHostTemplates(templateProcessor).isEmpty()) { updateConfigsInTemplate(templateProcessor, generateConfigs(templateProcessor, source)); } } }
CmHostGroupRoleConfigProviderProcessor { public void process(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) { if (!getHostTemplates(templateProcessor).isEmpty()) { updateConfigsInTemplate(templateProcessor, generateConfigs(templateProcessor, source)); } }  }
CmHostGroupRoleConfigProviderProcessor { public void process(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) { if (!getHostTemplates(templateProcessor).isEmpty()) { updateConfigsInTemplate(templateProcessor, generateConfigs(templateProcessor, source)); } }  void process(CmTemplateProcessor templateProcessor, TemplatePreparationObject source); }
CmHostGroupRoleConfigProviderProcessor { public void process(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) { if (!getHostTemplates(templateProcessor).isEmpty()) { updateConfigsInTemplate(templateProcessor, generateConfigs(templateProcessor, source)); } }  void process(CmTemplateProcessor templateProcessor, TemplatePreparationObject source);  }