@Test public void testGetStreamsMessagingManagerServerConfigs() { String inputJson = getBlueprintText("input/cdp-streaming.bp").replace("__CDH_VERSION__", "7.2.0"); CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson); TemplatePreparationObject preparationObject = getTemplatePreparationObject(null, false, cmTemplateProcessor); List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject); assertThat(serviceConfigs).hasSameElementsAs(List.of( config(DATABASE_TYPE, "postgresql"), config(DATABASE_NAME, "smm"), config(DATABASE_HOST, "testhost"), config(DATABASE_PORT, "5432"), config(DATABASE_USER, "smm_server"), config(DATABASE_PASSWORD, "smm_server_db_password") )); }
@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; }
StreamsMessagingManagerServiceConfigProvider extends AbstractRdsRoleConfigProvider { @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; } }
StreamsMessagingManagerServiceConfigProvider extends AbstractRdsRoleConfigProvider { @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; }  }
StreamsMessagingManagerServiceConfigProvider extends AbstractRdsRoleConfigProvider { @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; }  @Override List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source); @Override String getServiceType(); @Override List<String> getRoleTypes(); }
StreamsMessagingManagerServiceConfigProvider extends AbstractRdsRoleConfigProvider { @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; }  @Override List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source); @Override String getServiceType(); @Override List<String> getRoleTypes();  }