@Test public void testGetYarnCloudStorageRoleConfigs() { TemplatePreparationObject preparationObject = getTemplatePreparationObject(true); String inputJson = getBlueprintText("input/clouderamanager.bp"); CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson); Map<String, List<ApiClusterTemplateConfig>> roleConfigs = underTest.getRoleConfigs(cmTemplateProcessor, preparationObject); List<ApiClusterTemplateConfig> yarnStorageConfigs = roleConfigs.get("yarn-NODEMANAGER-BASE"); assertEquals(1, yarnStorageConfigs.size()); assertEquals("yarn_nodemanager_remote_app_log_dir", yarnStorageConfigs.get(0).getName()); assertEquals("s3a: }
@Override protected List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, TemplatePreparationObject source) { switch (roleType) { case YarnRoles.NODEMANAGER: return ConfigUtils.getStorageLocationForServiceProperty(source, NODEMANAGER_REMOTE_APP_LOG_DIR) .map(location -> List.of(config(NODEMANAGER_REMOTE_APP_LOG_DIR_TEMPLATE_PARAM, location.getValue()))) .orElseGet(List::of); default: return List.of(); } }
YarnCloudStorageRoleConfigProvider extends AbstractRoleConfigProvider { @Override protected List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, TemplatePreparationObject source) { switch (roleType) { case YarnRoles.NODEMANAGER: return ConfigUtils.getStorageLocationForServiceProperty(source, NODEMANAGER_REMOTE_APP_LOG_DIR) .map(location -> List.of(config(NODEMANAGER_REMOTE_APP_LOG_DIR_TEMPLATE_PARAM, location.getValue()))) .orElseGet(List::of); default: return List.of(); } } }
YarnCloudStorageRoleConfigProvider extends AbstractRoleConfigProvider { @Override protected List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, TemplatePreparationObject source) { switch (roleType) { case YarnRoles.NODEMANAGER: return ConfigUtils.getStorageLocationForServiceProperty(source, NODEMANAGER_REMOTE_APP_LOG_DIR) .map(location -> List.of(config(NODEMANAGER_REMOTE_APP_LOG_DIR_TEMPLATE_PARAM, location.getValue()))) .orElseGet(List::of); default: return List.of(); } }  }
YarnCloudStorageRoleConfigProvider extends AbstractRoleConfigProvider { @Override protected List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, TemplatePreparationObject source) { switch (roleType) { case YarnRoles.NODEMANAGER: return ConfigUtils.getStorageLocationForServiceProperty(source, NODEMANAGER_REMOTE_APP_LOG_DIR) .map(location -> List.of(config(NODEMANAGER_REMOTE_APP_LOG_DIR_TEMPLATE_PARAM, location.getValue()))) .orElseGet(List::of); default: return List.of(); } }  @Override String getServiceType(); @Override List<String> getRoleTypes(); @Override boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source); }
YarnCloudStorageRoleConfigProvider extends AbstractRoleConfigProvider { @Override protected List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, TemplatePreparationObject source) { switch (roleType) { case YarnRoles.NODEMANAGER: return ConfigUtils.getStorageLocationForServiceProperty(source, NODEMANAGER_REMOTE_APP_LOG_DIR) .map(location -> List.of(config(NODEMANAGER_REMOTE_APP_LOG_DIR_TEMPLATE_PARAM, location.getValue()))) .orElseGet(List::of); default: return List.of(); } }  @Override String getServiceType(); @Override List<String> getRoleTypes(); @Override boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source);  }