@Test public void validateRangerServiceConfigPost72() { String inputJson = getBlueprintText("input/cb6720.bp"); CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson); HostgroupView master = new HostgroupView("master", 1, InstanceGroupType.GATEWAY, 1); TemplatePreparationObject preparationObject = Builder.builder().withHostgroupViews(Set.of(master)) .withBlueprintView(new BlueprintView(inputJson, "", "", cmTemplateProcessor)) .withRdsConfigs(Set.of(rdsConfig(DatabaseType.RANGER))) .build(); List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject); assertEquals(6, serviceConfigs.size()); assertEquals("ranger_database_host", serviceConfigs.get(0).getName()); assertEquals("10.1.1.1", serviceConfigs.get(0).getValue()); assertEquals("ranger_database_name", serviceConfigs.get(1).getName()); assertEquals("ranger", serviceConfigs.get(1).getValue()); assertEquals("ranger_database_type", serviceConfigs.get(2).getName()); assertEquals("postgresql", serviceConfigs.get(2).getValue()); assertEquals("ranger_database_user", serviceConfigs.get(3).getName()); assertEquals("heyitsme", serviceConfigs.get(3).getValue()); assertEquals("ranger_database_password", serviceConfigs.get(4).getName()); assertEquals("iamsoosecure", serviceConfigs.get(4).getValue()); assertEquals("ranger_database_port", serviceConfigs.get(5).getName()); assertEquals("5432", serviceConfigs.get(5).getValue()); }
@Override public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) { String cdhVersion = getCdhVersion(source); List<ApiClusterTemplateConfig> configList = new ArrayList<>(); if (isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_2_1)) { RdsView rangerRdsView = getRdsView(source); addDbConfigs(rangerRdsView, configList, cdhVersion); configList.add(config("ranger_database_port", rangerRdsView.getPort())); } return configList; }
RangerRoleConfigProvider extends AbstractRdsRoleConfigProvider { @Override public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) { String cdhVersion = getCdhVersion(source); List<ApiClusterTemplateConfig> configList = new ArrayList<>(); if (isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_2_1)) { RdsView rangerRdsView = getRdsView(source); addDbConfigs(rangerRdsView, configList, cdhVersion); configList.add(config("ranger_database_port", rangerRdsView.getPort())); } return configList; } }
RangerRoleConfigProvider extends AbstractRdsRoleConfigProvider { @Override public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) { String cdhVersion = getCdhVersion(source); List<ApiClusterTemplateConfig> configList = new ArrayList<>(); if (isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_2_1)) { RdsView rangerRdsView = getRdsView(source); addDbConfigs(rangerRdsView, configList, cdhVersion); configList.add(config("ranger_database_port", rangerRdsView.getPort())); } return configList; }  }
RangerRoleConfigProvider extends AbstractRdsRoleConfigProvider { @Override public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) { String cdhVersion = getCdhVersion(source); List<ApiClusterTemplateConfig> configList = new ArrayList<>(); if (isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_2_1)) { RdsView rangerRdsView = getRdsView(source); addDbConfigs(rangerRdsView, configList, cdhVersion); configList.add(config("ranger_database_port", rangerRdsView.getPort())); } return configList; }  @Override List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source); @Override String getServiceType(); @Override List<String> getRoleTypes(); }
RangerRoleConfigProvider extends AbstractRdsRoleConfigProvider { @Override public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) { String cdhVersion = getCdhVersion(source); List<ApiClusterTemplateConfig> configList = new ArrayList<>(); if (isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_2_1)) { RdsView rangerRdsView = getRdsView(source); addDbConfigs(rangerRdsView, configList, cdhVersion); configList.add(config("ranger_database_port", rangerRdsView.getPort())); } return configList; }  @Override List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source); @Override String getServiceType(); @Override List<String> getRoleTypes();  }