@Test public void testGetHiveLlapServiceConfigsWhenNoStorageConfigured() { TemplatePreparationObject preparationObject = getTemplatePreparationObject(false); String inputJson = getBlueprintText("input/clouderamanager-ds.bp"); CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson); List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject); assertEquals(0, serviceConfigs.size()); }
@Override public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) { return ConfigUtils.getStorageLocationForServiceProperty(source, HMS_METASTORE_EXTERNAL_DIR) .map(location -> location.getValue().replaceAll("/?$", "") + HIVE_HOOK_PROTO_BASE_DIR_SUFFIX) .map(logDir -> List.of(config(HIVE_HOOK_PROTO_BASE_DIR_PARAM, logDir))) .orElseGet(List::of); }
HiveLLAPServiceConfigProvider implements CmTemplateComponentConfigProvider { @Override public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) { return ConfigUtils.getStorageLocationForServiceProperty(source, HMS_METASTORE_EXTERNAL_DIR) .map(location -> location.getValue().replaceAll("/?$", "") + HIVE_HOOK_PROTO_BASE_DIR_SUFFIX) .map(logDir -> List.of(config(HIVE_HOOK_PROTO_BASE_DIR_PARAM, logDir))) .orElseGet(List::of); } }
HiveLLAPServiceConfigProvider implements CmTemplateComponentConfigProvider { @Override public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) { return ConfigUtils.getStorageLocationForServiceProperty(source, HMS_METASTORE_EXTERNAL_DIR) .map(location -> location.getValue().replaceAll("/?$", "") + HIVE_HOOK_PROTO_BASE_DIR_SUFFIX) .map(logDir -> List.of(config(HIVE_HOOK_PROTO_BASE_DIR_PARAM, logDir))) .orElseGet(List::of); }  }
HiveLLAPServiceConfigProvider implements CmTemplateComponentConfigProvider { @Override public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) { return ConfigUtils.getStorageLocationForServiceProperty(source, HMS_METASTORE_EXTERNAL_DIR) .map(location -> location.getValue().replaceAll("/?$", "") + HIVE_HOOK_PROTO_BASE_DIR_SUFFIX) .map(logDir -> List.of(config(HIVE_HOOK_PROTO_BASE_DIR_PARAM, logDir))) .orElseGet(List::of); }  @Override List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source); @Override String getServiceType(); @Override List<String> getRoleTypes(); @Override boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source); }
HiveLLAPServiceConfigProvider implements CmTemplateComponentConfigProvider { @Override public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) { return ConfigUtils.getStorageLocationForServiceProperty(source, HMS_METASTORE_EXTERNAL_DIR) .map(location -> location.getValue().replaceAll("/?$", "") + HIVE_HOOK_PROTO_BASE_DIR_SUFFIX) .map(logDir -> List.of(config(HIVE_HOOK_PROTO_BASE_DIR_PARAM, logDir))) .orElseGet(List::of); }  @Override List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source); @Override String getServiceType(); @Override List<String> getRoleTypes(); @Override boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source);  }