@Test public void testGetConfigsWhenLlapIsNotPresent() { when(cmTemplateProcessor.getServiceByType(eq(HiveRoles.HIVELLAP))).thenReturn(Optional.empty()); List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, null); assertEquals(0, serviceConfigs.size()); assertFalse(serviceConfigs.stream().anyMatch(sc -> StringUtils.equals(sc.getName(), "yarn_service_config_safety_valve"))); }
@Override public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject templatePreparationObject) { List<ApiClusterTemplateConfig> apiClusterTemplateConfigs = Lists.newArrayList(); if (templateProcessor.getServiceByType(HiveRoles.HIVELLAP).isPresent()) { apiClusterTemplateConfigs.add(config(YARN_SITE_SERVICE_SAFETY_VALVE, getYarnSiteServiceValveValue())); } return apiClusterTemplateConfigs; }
YarnConfigProvider implements CmTemplateComponentConfigProvider { @Override public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject templatePreparationObject) { List<ApiClusterTemplateConfig> apiClusterTemplateConfigs = Lists.newArrayList(); if (templateProcessor.getServiceByType(HiveRoles.HIVELLAP).isPresent()) { apiClusterTemplateConfigs.add(config(YARN_SITE_SERVICE_SAFETY_VALVE, getYarnSiteServiceValveValue())); } return apiClusterTemplateConfigs; } }
YarnConfigProvider implements CmTemplateComponentConfigProvider { @Override public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject templatePreparationObject) { List<ApiClusterTemplateConfig> apiClusterTemplateConfigs = Lists.newArrayList(); if (templateProcessor.getServiceByType(HiveRoles.HIVELLAP).isPresent()) { apiClusterTemplateConfigs.add(config(YARN_SITE_SERVICE_SAFETY_VALVE, getYarnSiteServiceValveValue())); } return apiClusterTemplateConfigs; }  }
YarnConfigProvider implements CmTemplateComponentConfigProvider { @Override public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject templatePreparationObject) { List<ApiClusterTemplateConfig> apiClusterTemplateConfigs = Lists.newArrayList(); if (templateProcessor.getServiceByType(HiveRoles.HIVELLAP).isPresent()) { apiClusterTemplateConfigs.add(config(YARN_SITE_SERVICE_SAFETY_VALVE, getYarnSiteServiceValveValue())); } return apiClusterTemplateConfigs; }  @Override List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject templatePreparationObject); @Override String getServiceType(); @Override List<String> getRoleTypes(); @Override boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source); }
YarnConfigProvider implements CmTemplateComponentConfigProvider { @Override public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject templatePreparationObject) { List<ApiClusterTemplateConfig> apiClusterTemplateConfigs = Lists.newArrayList(); if (templateProcessor.getServiceByType(HiveRoles.HIVELLAP).isPresent()) { apiClusterTemplateConfigs.add(config(YARN_SITE_SERVICE_SAFETY_VALVE, getYarnSiteServiceValveValue())); } return apiClusterTemplateConfigs; }  @Override List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject templatePreparationObject); @Override String getServiceType(); @Override List<String> getRoleTypes(); @Override boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source);  }