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;
}
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;
}
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);
}
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();
}
}
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;
}
Aggregations