Search in sources :

Example 96 with ApiClusterTemplateConfig

use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.

the class NifiRegistryConfigProvider method getServiceConfigs.

@Override
public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) {
    List<ApiClusterTemplateConfig> configList = new ArrayList<>();
    String cdhVersion = source.getBlueprintView().getProcessor().getStackVersion() == null ? "" : source.getBlueprintView().getProcessor().getStackVersion();
    if (isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_1_0)) {
        VirtualGroupRequest virtualGroupRequest = source.getVirtualGroupRequest();
        String adminGroup = virtualGroupService.createOrGetVirtualGroup(virtualGroupRequest, UmsVirtualGroupRight.NIFI_REGISTRY_ADMIN);
        configList.add(config("nifi.registry.initial.admin.groups", adminGroup));
        rangerAutoCompleteConfigProvider.extendServiceConfigs(source, configList);
    }
    return configList;
}
Also used : VirtualGroupRequest(com.sequenceiq.cloudbreak.auth.altus.VirtualGroupRequest) ArrayList(java.util.ArrayList) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig)

Example 97 with ApiClusterTemplateConfig

use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.

the class HueConfigProvider method getServiceConfigs.

@Override
public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) {
    List<ApiClusterTemplateConfig> result = new ArrayList<>();
    result.add(new ApiClusterTemplateConfig().name("database_host").variable(HUE_DATABASE_HOST));
    result.add(new ApiClusterTemplateConfig().name("database_port").variable(HUE_DATABASE_PORT));
    result.add(new ApiClusterTemplateConfig().name("database_name").variable(HUE_DATABASE_NAME));
    result.add(new ApiClusterTemplateConfig().name("database_type").variable(HUE_HUE_DATABASE_TYPE));
    result.add(new ApiClusterTemplateConfig().name("database_user").variable(HUE_HUE_DATABASE_USER));
    result.add(new ApiClusterTemplateConfig().name("database_password").variable(HUE_DATABASE_PASSWORD));
    configureKnoxProxyHostsServiceConfig(source, result);
    return result;
}
Also used : ArrayList(java.util.ArrayList) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig)

Example 98 with ApiClusterTemplateConfig

use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.

the class HiveMetastoreConfigProvider method getServiceConfigs.

@Override
public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) {
    RdsView hiveRdsView = getRdsView(source);
    List<ApiClusterTemplateConfig> configs = Lists.newArrayList(config(HIVE_METASTORE_DATABASE_HOST, hiveRdsView.getHost()), config(HIVE_METASTORE_DATABASE_NAME, hiveRdsView.getDatabaseName()), config(HIVE_METASTORE_DATABASE_PASSWORD, hiveRdsView.getConnectionPassword()), config(HIVE_METASTORE_DATABASE_PORT, hiveRdsView.getPort()), config(HIVE_METASTORE_DATABASE_TYPE, hiveRdsView.getSubprotocol()), config(HIVE_METASTORE_DATABASE_USER, hiveRdsView.getConnectionUserName()));
    String cmVersion = getCmVersion(source);
    addDbSslConfigsIfNeeded(templateProcessor, hiveRdsView, configs, cmVersion);
    // The Initiator thread in the DataLake's HMS will take care of this.
    if (source.getStackType() == StackType.WORKLOAD && isVersionNewerOrEqualThanLimited(cmVersion, CLOUDERAMANAGER_VERSION_7_1_1)) {
        configs.add(config(HIVE_COMPACTOR_INITIATOR_ON, Boolean.FALSE.toString()));
    }
    Optional<KerberosConfig> kerberosConfigOpt = source.getKerberosConfig();
    if (kerberosConfigOpt.isPresent()) {
        String safetyValveValue = getSafetyValveProperty("hive.hook.proto.file.per.event", Boolean.TRUE.toString());
        configs.add(config(HIVE_SERVICE_CONFIG_SAFETY_VALVE, safetyValveValue));
    }
    if (source.getStackType() == StackType.DATALAKE) {
        source.getLdapConfig().ifPresent(ldap -> {
            configs.add(config(HIVE_METASTORE_ENABLE_LDAP_AUTH, Boolean.TRUE.toString()));
            configs.add(config(HIVE_METASTORE_LDAP_URI, ldap.getConnectionURL()));
            configs.add(config(HIVE_METASTORE_LDAP_BASEDN, ldap.getUserSearchBase()));
        });
    }
    return configs;
}
Also used : RdsView(com.sequenceiq.cloudbreak.template.views.RdsView) KerberosConfig(com.sequenceiq.cloudbreak.dto.KerberosConfig) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig)

Example 99 with ApiClusterTemplateConfig

use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.

the class HbaseServiceConfigProvider method getServiceConfigs.

@Override
public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) {
    List<ApiClusterTemplateConfig> configList = new ArrayList<>();
    String cmVersion = templateProcessor.getCmVersion().orElse("");
    if (isVersionNewerOrEqualThanLimited(cmVersion, CLOUDERAMANAGER_VERSION_7_2_0)) {
        VirtualGroupRequest virtualGroupRequest = source.getVirtualGroupRequest();
        String adminGroup = virtualGroupService.createOrGetVirtualGroup(virtualGroupRequest, UmsVirtualGroupRight.HBASE_ADMIN);
        configList.add(config(SPNEGO_ADMIN_GROUP, adminGroup));
    }
    return configList;
}
Also used : VirtualGroupRequest(com.sequenceiq.cloudbreak.auth.altus.VirtualGroupRequest) ArrayList(java.util.ArrayList) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig)

Example 100 with ApiClusterTemplateConfig

use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.

the class SchemaRegistryServiceConfigProviderTest method testGetSchemaRegistryRoleConfigs720.

@Test
public void testGetSchemaRegistryRoleConfigs720() {
    String inputJson = loadBlueprint("7.2.0");
    CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
    TemplatePreparationObject preparationObject = getTemplatePreparationObject(cmTemplateProcessor);
    List<ApiClusterTemplateConfig> roleConfigs = underTest.getRoleConfigs(SchemaRegistryRoles.SCHEMA_REGISTRY_SERVER, preparationObject);
    assertThat(roleConfigs).hasSameElementsAs(List.of(config(RANGER_PLUGIN_SR_SERVICE_NAME, GENERATED_RANGER_SERVICE_NAME)));
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) Test(org.junit.Test)

Aggregations

ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)172 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)129 Test (org.junit.Test)78 CmTemplateProcessor (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor)74 Test (org.junit.jupiter.api.Test)57 ArrayList (java.util.ArrayList)55 List (java.util.List)50 HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)25 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)22 Builder (com.sequenceiq.cloudbreak.template.TemplatePreparationObject.Builder)21 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)18 GeneralClusterConfigs (com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs)17 BlueprintView (com.sequenceiq.cloudbreak.template.views.BlueprintView)17 ApiClusterTemplateService (com.cloudera.api.swagger.model.ApiClusterTemplateService)13 AccountMappingView (com.sequenceiq.cloudbreak.template.views.AccountMappingView)13 ApiClusterTemplateRoleConfigGroup (com.cloudera.api.swagger.model.ApiClusterTemplateRoleConfigGroup)12 HashMap (java.util.HashMap)12 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)11 BaseFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView)9 BlueprintTextProcessor (com.sequenceiq.cloudbreak.template.processor.BlueprintTextProcessor)8