Search in sources :

Example 1 with RdsView

use of com.sequenceiq.cloudbreak.template.views.RdsView in project cloudbreak by hortonworks.

the class ClusterServicesRestartService method getRdsConfigMap.

private Map<String, String> getRdsConfigMap(RDSConfig rdsConfig) {
    RdsView hiveRdsView = new RdsView(rdsConfig, dbCertificateProvider.getSslCertsFilePath());
    Map<String, String> configs = new HashMap<String, String>();
    configs.put(HIVE_METASTORE_DATABASE_HOST, hiveRdsView.getHost());
    configs.put(HIVE_METASTORE_DATABASE_NAME, hiveRdsView.getDatabaseName());
    configs.put(HIVE_METASTORE_DATABASE_PASSWORD, hiveRdsView.getConnectionPassword());
    configs.put(HIVE_METASTORE_DATABASE_PORT, hiveRdsView.getPort());
    configs.put(HIVE_METASTORE_DATABASE_TYPE, hiveRdsView.getSubprotocol());
    configs.put(HIVE_METASTORE_DATABASE_USER, hiveRdsView.getConnectionUserName());
    configs.put(JDBC_URL_OVERRIDE, hiveRdsView.getConnectionURL());
    return configs;
}
Also used : HashMap(java.util.HashMap) RdsView(com.sequenceiq.cloudbreak.template.views.RdsView)

Example 2 with RdsView

use of com.sequenceiq.cloudbreak.template.views.RdsView in project cloudbreak by hortonworks.

the class TemplateModelContextBuilder method withRdsConfigs.

public TemplateModelContextBuilder withRdsConfigs(Iterable<RDSConfig> rdsConfigs) {
    for (RDSConfig rdsConfig : rdsConfigs) {
        if (rdsConfig != null) {
            RdsView rdsView = new RdsView(rdsConfig);
            String componentName = rdsConfig.getType().toLowerCase();
            rds.put(componentName, rdsView);
        }
    }
    return this;
}
Also used : RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) RdsView(com.sequenceiq.cloudbreak.template.views.RdsView)

Example 3 with RdsView

use of com.sequenceiq.cloudbreak.template.views.RdsView in project cloudbreak by hortonworks.

the class AbstractRdsRoleConfigProviderTest method getRdsViewTest.

@Test
void getRdsViewTest() {
    RDSConfig rdsConfig = rdsConfig(DatabaseType.RANGER);
    when(source.getRdsConfig(DatabaseType.RANGER)).thenReturn(rdsConfig);
    when(source.getRdsSslCertificateFilePath()).thenReturn(SSL_CERTS_FILE_PATH);
    RdsView rdsView = subject.getRdsView(source);
    assertThat(rdsView).isNotNull();
    assertThat(rdsView.getSslCertificateFilePath()).isEqualTo(SSL_CERTS_FILE_PATH);
}
Also used : RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) RdsView(com.sequenceiq.cloudbreak.template.views.RdsView) Test(org.junit.jupiter.api.Test)

Example 4 with RdsView

use of com.sequenceiq.cloudbreak.template.views.RdsView in project cloudbreak by hortonworks.

the class RangerRoleConfigProvider method getRoleConfigs.

@Override
protected List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, TemplatePreparationObject source) {
    switch(roleType) {
        case RangerRoles.RANGER_ADMIN:
            String cmVersion = getCmVersion(source);
            List<ApiClusterTemplateConfig> configList = new ArrayList<>();
            // In CM 7.2.1 and above, the ranger database parameters have moved to the service
            // config (see above getServiceConfigs).
            RdsView rangerRdsView = getRdsView(source);
            if (!isVersionNewerOrEqualThanLimited(cmVersion, CLOUDERAMANAGER_VERSION_7_2_1)) {
                addDbConfigs(rangerRdsView, configList, cmVersion);
            }
            addDbSslConfigsIfNeeded(rangerRdsView, configList, cmVersion);
            VirtualGroupRequest virtualGroupRequest = source.getVirtualGroupRequest();
            if (isVersionNewerOrEqualThanLimited(cmVersion, CLOUDERAMANAGER_VERSION_7_0_1)) {
                String adminGroup = virtualGroupService.createOrGetVirtualGroup(virtualGroupRequest, UmsVirtualGroupRight.RANGER_ADMIN);
                configList.add(config(RANGER_DEFAULT_POLICY_GROUPS, adminGroup));
            }
            if (isVersionNewerOrEqualThanLimited(cmVersion, CLOUDERAMANAGER_VERSION_7_6_0)) {
                String hbaseAdminGroup = virtualGroupService.createOrGetVirtualGroup(virtualGroupRequest, UmsVirtualGroupRight.HBASE_ADMIN);
                configList.add(config(RANGER_HBASE_ADMIN_VIRTUAL_GROUPS, hbaseAdminGroup));
            }
            return configList;
        default:
            return List.of();
    }
}
Also used : VirtualGroupRequest(com.sequenceiq.cloudbreak.auth.altus.VirtualGroupRequest) RdsView(com.sequenceiq.cloudbreak.template.views.RdsView) ArrayList(java.util.ArrayList) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig)

Example 5 with RdsView

use of com.sequenceiq.cloudbreak.template.views.RdsView in project cloudbreak by hortonworks.

the class StreamsMessagingManagerServiceConfigProvider method getServiceConfigs.

@Override
public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) {
    final List<ApiClusterTemplateConfig> configList;
    String cdhVersion = source.getBlueprintView().getProcessor().getStackVersion() == null ? "" : source.getBlueprintView().getProcessor().getStackVersion();
    if (isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_2_0)) {
        RdsView smmRdsView = getRdsView(source);
        configList = List.of(config(DATABASE_TYPE, dataBaseTypeForCM(smmRdsView.getDatabaseVendor())), config(DATABASE_NAME, smmRdsView.getDatabaseName()), config(DATABASE_HOST, smmRdsView.getHost()), config(DATABASE_PORT, smmRdsView.getPort()), config(DATABASE_USER, smmRdsView.getConnectionUserName()), config(DATABASE_PASSWORD, smmRdsView.getConnectionPassword()));
    } else {
        String cmHost = source.getGeneralClusterConfigs().getPrimaryGatewayInstanceDiscoveryFQDN().orElse(source.getGeneralClusterConfigs().getClusterManagerIp());
        boolean ssl = source.getGeneralClusterConfigs().getAutoTlsEnabled();
        configList = Lists.newArrayList(config("cm.metrics.host", cmHost), config("cm.metrics.username", source.getGeneralClusterConfigs().getCloudbreakAmbariUser()), config("cm.metrics.password", source.getGeneralClusterConfigs().getCloudbreakAmbariPassword()), config("cm.metrics.protocol", ssl ? "https" : "http"), config("cm.metrics.port", ssl ? "7183" : "7180"));
    }
    return configList;
}
Also used : RdsView(com.sequenceiq.cloudbreak.template.views.RdsView) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig)

Aggregations

RdsView (com.sequenceiq.cloudbreak.template.views.RdsView)12 ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)6 ArrayList (java.util.ArrayList)5 RDSConfig (com.sequenceiq.cloudbreak.domain.RDSConfig)2 HashMap (java.util.HashMap)2 ApiClusterTemplateVariable (com.cloudera.api.swagger.model.ApiClusterTemplateVariable)1 VirtualGroupRequest (com.sequenceiq.cloudbreak.auth.altus.VirtualGroupRequest)1 RdsConfigWithoutCluster (com.sequenceiq.cloudbreak.domain.view.RdsConfigWithoutCluster)1 KerberosConfig (com.sequenceiq.cloudbreak.dto.KerberosConfig)1 CloudbreakOrchestratorFailedException (com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorFailedException)1 SaltPillarProperties (com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties)1 Test (org.junit.jupiter.api.Test)1