use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class RangerRazDatalakeConfigProviderTest method getAdditionalServicesWhenRazIsEnabledWithCm710.
@ParameterizedTest(name = "{0}")
@MethodSource("razCloudPlatformDataProvider")
@DisplayName("CM 7.1.0 DL is used and Raz is requested, no additional service needs to be added to the template")
void getAdditionalServicesWhenRazIsEnabledWithCm710(String testCaseName, CloudPlatform cloudPlatform) {
ClouderaManagerRepo cmRepo = new ClouderaManagerRepo();
cmRepo.setVersion("7.1.0");
GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
generalClusterConfigs.setEnableRangerRaz(true);
HostgroupView master = new HostgroupView("master", 0, InstanceGroupType.GATEWAY, List.of());
HostgroupView idbroker = new HostgroupView("idbroker", 0, InstanceGroupType.CORE, List.of());
TemplatePreparationObject preparationObject = Builder.builder().withStackType(StackType.DATALAKE).withCloudPlatform(cloudPlatform).withProductDetails(cmRepo, List.of()).withGeneralClusterConfigs(generalClusterConfigs).withHostgroupViews(Set.of(master, idbroker)).build();
Map<String, ApiClusterTemplateService> additionalServices = configProvider.getAdditionalServices(cmTemplateProcessor, preparationObject);
assertEquals(0, additionalServices.size());
}
use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class RangerRazDatalakeConfigProviderTest method getAdditionalServicesWhenRazIsEnabledWithRightCm.
@ParameterizedTest(name = "{0}")
@MethodSource("razCloudPlatformAndCmVersionDataProvider")
@DisplayName("DL is used with the right CM and Raz is requested, Raz service needs to be added to the template")
void getAdditionalServicesWhenRazIsEnabledWithRightCm(String testCaseName, CloudPlatform cloudPlatform, String cmVersion) {
ClouderaManagerRepo cmRepo = new ClouderaManagerRepo();
cmRepo.setVersion(cmVersion);
GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
generalClusterConfigs.setEnableRangerRaz(true);
HostgroupView master = new HostgroupView("master", 0, InstanceGroupType.GATEWAY, List.of());
HostgroupView idbroker = new HostgroupView("idbroker", 0, InstanceGroupType.CORE, List.of());
TemplatePreparationObject preparationObject = Builder.builder().withStackType(StackType.DATALAKE).withCloudPlatform(cloudPlatform).withProductDetails(cmRepo, List.of()).withGeneralClusterConfigs(generalClusterConfigs).withHostgroupViews(Set.of(master, idbroker)).build();
Map<String, ApiClusterTemplateService> additionalServices = configProvider.getAdditionalServices(cmTemplateProcessor, preparationObject);
ApiClusterTemplateService service = additionalServices.get("master");
List<ApiClusterTemplateRoleConfigGroup> roleConfigGroups = service.getRoleConfigGroups();
Assertions.assertAll(() -> assertEquals(1, additionalServices.size()), () -> assertEquals("RANGER_RAZ", service.getServiceType()), () -> assertEquals("ranger-RANGER_RAZ", service.getRefName()), () -> assertEquals("RANGER_RAZ_SERVER", roleConfigGroups.get(0).getRoleType()), () -> assertEquals("ranger-RANGER_RAZ_SERVER", roleConfigGroups.get(0).getRefName()));
}
use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class RangerRazDatalakeConfigProviderTest method getAdditionalServicesWhenRazIsEnabledAndNotAwsOrAzure.
@Test
@DisplayName("CM 7.2.0 DL is used and Raz is requested, but YARN, no additional service needs to be added to the template")
void getAdditionalServicesWhenRazIsEnabledAndNotAwsOrAzure() {
ClouderaManagerRepo cmRepo = new ClouderaManagerRepo();
cmRepo.setVersion("7.2.0");
GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
generalClusterConfigs.setEnableRangerRaz(true);
HostgroupView master = new HostgroupView("master", 0, InstanceGroupType.GATEWAY, List.of());
HostgroupView idbroker = new HostgroupView("idbroker", 0, InstanceGroupType.CORE, List.of());
TemplatePreparationObject preparationObject = Builder.builder().withStackType(StackType.DATALAKE).withCloudPlatform(CloudPlatform.YARN).withProductDetails(cmRepo, List.of()).withGeneralClusterConfigs(generalClusterConfigs).withHostgroupViews(Set.of(master, idbroker)).build();
Map<String, ApiClusterTemplateService> additionalServices = configProvider.getAdditionalServices(cmTemplateProcessor, preparationObject);
assertEquals(0, additionalServices.size());
}
use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class SchemaRegistryJarStorageConfigProviderTest method testCloudStorageIsChosenWhenCdhVersionIsAtLeast711.
@Test
void testCloudStorageIsChosenWhenCdhVersionIsAtLeast711() {
cdhMainVersionIs("7.2.0");
TemplatePreparationObject tpo = getTemplatePreparationObject(1);
HostgroupView hostGroup = tpo.getHostGroupsWithComponent(SCHEMA_REGISTRY_SERVER).findFirst().get();
assertEquals(List.of(config(CONFIG_JAR_STORAGE_DIRECTORY_PATH, "/schema-registry"), config(CONFIG_JAR_STORAGE_TYPE, "hdfs")), subject.getRoleConfigs(SCHEMA_REGISTRY_SERVER, hostGroup, tpo));
}
use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class SchemaRegistryJarStorageConfigProviderTest method testRoleConfigsWithMultipleVolumes.
@Test
void testRoleConfigsWithMultipleVolumes() {
HostgroupView hostGroup = hostGroupWithVolumeCount(3);
assertEquals(List.of(config("schema.registry.jar.storage.directory.path", "/hadoopfs/fs1/schema_registry")), subject.getRoleConfigs(SCHEMA_REGISTRY_SERVER, hostGroup, getTemplatePreparationObject(hostGroup)));
}
Aggregations