Search in sources :

Example 1 with CORE_SETTINGS

use of com.sequenceiq.cloudbreak.cmtemplate.configproviders.core.CoreRoles.CORE_SETTINGS in project cloudbreak by hortonworks.

the class CoreConfigProvider method getAdditionalServices.

@Override
public Map<String, ApiClusterTemplateService> getAdditionalServices(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source) {
    if (isConfigurationNeeded(cmTemplateProcessor, source) && cmTemplateProcessor.getServiceByType(CORE_SETTINGS).isEmpty()) {
        ApiClusterTemplateService coreSettings = createBaseCoreSettingsService();
        Set<HostgroupView> hostgroupViews = source.getHostgroupViews();
        return hostgroupViews.stream().filter(hg -> InstanceGroupType.GATEWAY.equals(hg.getInstanceGroupType())).collect(Collectors.toMap(HostgroupView::getName, v -> coreSettings));
    }
    return Map.of();
}
Also used : ConfigUtils.config(com.sequenceiq.cloudbreak.cmtemplate.configproviders.ConfigUtils.config) ArrayList(java.util.ArrayList) ConfigUtils(com.sequenceiq.cloudbreak.cmtemplate.configproviders.ConfigUtils) Inject(javax.inject.Inject) Lists(com.google.common.collect.Lists) CORE_SETTINGS(com.sequenceiq.cloudbreak.cmtemplate.configproviders.core.CoreRoles.CORE_SETTINGS) Map(java.util.Map) ApiClusterTemplateRoleConfigGroup(com.cloudera.api.swagger.model.ApiClusterTemplateRoleConfigGroup) ApiClusterTemplateService(com.cloudera.api.swagger.model.ApiClusterTemplateService) HDFS(com.sequenceiq.cloudbreak.cmtemplate.configproviders.hdfs.HdfsRoles.HDFS) CORE_SETTINGS_REF_NAME(com.sequenceiq.cloudbreak.cmtemplate.configproviders.core.CoreRoles.CORE_SETTINGS_REF_NAME) NAMENODE(com.sequenceiq.cloudbreak.cmtemplate.configproviders.hdfs.HdfsRoles.NAMENODE) AbstractRoleConfigProvider(com.sequenceiq.cloudbreak.cmtemplate.configproviders.AbstractRoleConfigProvider) CORE_SETTINGS_SERVICE_REF_NAME(com.sequenceiq.cloudbreak.cmtemplate.configproviders.core.CoreRoles.CORE_SETTINGS_SERVICE_REF_NAME) Set(java.util.Set) Collectors(java.util.stream.Collectors) TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) InstanceGroupType(com.sequenceiq.common.api.type.InstanceGroupType) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) List(java.util.List) Component(org.springframework.stereotype.Component) S3ConfigProvider(com.sequenceiq.cloudbreak.cmtemplate.configproviders.s3.S3ConfigProvider) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) Optional(java.util.Optional) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) STORAGEOPERATIONS(com.sequenceiq.cloudbreak.cmtemplate.configproviders.core.CoreRoles.STORAGEOPERATIONS) ApiClusterTemplateService(com.cloudera.api.swagger.model.ApiClusterTemplateService) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView)

Aggregations

ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)1 ApiClusterTemplateRoleConfigGroup (com.cloudera.api.swagger.model.ApiClusterTemplateRoleConfigGroup)1 ApiClusterTemplateService (com.cloudera.api.swagger.model.ApiClusterTemplateService)1 Lists (com.google.common.collect.Lists)1 CmTemplateProcessor (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor)1 AbstractRoleConfigProvider (com.sequenceiq.cloudbreak.cmtemplate.configproviders.AbstractRoleConfigProvider)1 ConfigUtils (com.sequenceiq.cloudbreak.cmtemplate.configproviders.ConfigUtils)1 ConfigUtils.config (com.sequenceiq.cloudbreak.cmtemplate.configproviders.ConfigUtils.config)1 CORE_SETTINGS (com.sequenceiq.cloudbreak.cmtemplate.configproviders.core.CoreRoles.CORE_SETTINGS)1 CORE_SETTINGS_REF_NAME (com.sequenceiq.cloudbreak.cmtemplate.configproviders.core.CoreRoles.CORE_SETTINGS_REF_NAME)1 CORE_SETTINGS_SERVICE_REF_NAME (com.sequenceiq.cloudbreak.cmtemplate.configproviders.core.CoreRoles.CORE_SETTINGS_SERVICE_REF_NAME)1 STORAGEOPERATIONS (com.sequenceiq.cloudbreak.cmtemplate.configproviders.core.CoreRoles.STORAGEOPERATIONS)1 HDFS (com.sequenceiq.cloudbreak.cmtemplate.configproviders.hdfs.HdfsRoles.HDFS)1 NAMENODE (com.sequenceiq.cloudbreak.cmtemplate.configproviders.hdfs.HdfsRoles.NAMENODE)1 S3ConfigProvider (com.sequenceiq.cloudbreak.cmtemplate.configproviders.s3.S3ConfigProvider)1 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)1 HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)1 InstanceGroupType (com.sequenceiq.common.api.type.InstanceGroupType)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1