Search in sources :

Example 1 with GeneralClusterConfigs

use of com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs in project cloudbreak by hortonworks.

the class RangerCloudStorageServiceConfigProviderTest method getTemplatePreparationObjectForAzure.

private TemplatePreparationObject.Builder getTemplatePreparationObjectForAzure(boolean above721) {
    HostgroupView gateway = new HostgroupView("gateway", 1, InstanceGroupType.GATEWAY, Set.of("g"));
    HostgroupView master = new HostgroupView("master", 1, InstanceGroupType.CORE, Set.of("m1", "m2"));
    HostgroupView worker = new HostgroupView("worker", 2, InstanceGroupType.CORE, Set.of("w1", "w2", "w3"));
    List<StorageLocationView> locations = new ArrayList<>();
    locations.add(new StorageLocationView(getRangerAuditCloudStorageDirAzure()));
    if (above721) {
        locations.add(new StorageLocationView(buildStorageLocation("hive.metastore.warehouse.dir", "abfs://data@your-san.dfs.core.windows.net/warehouse/tablespace/managed/hive")));
        locations.add(new StorageLocationView(buildStorageLocation("hive.repl.replica.functions.root.dir", "abfs://data@your-san.dfs.core.windows.net/hive_replica_functions_dir")));
        locations.add(new StorageLocationView(buildStorageLocation("hive.metastore.warehouse.external.dir", "abfs://data@your-san.dfs.core.windows.net/warehouse/tablespace/external/hive")));
        locations.add(new StorageLocationView(buildStorageLocation("hbase.rootdir", "abfs://data@your-san.dfs.core.windows.net/hbase")));
    }
    AdlsGen2FileSystemConfigurationsView fileSystemConfigurationsView = new AdlsGen2FileSystemConfigurationsView(new AdlsGen2FileSystem(), locations, false);
    GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
    generalClusterConfigs.setPrimaryGatewayInstanceDiscoveryFQDN(Optional.of("fqdn"));
    return Builder.builder().withFileSystemConfigurationView(fileSystemConfigurationsView).withHostgroupViews(Set.of(gateway, master, worker)).withGeneralClusterConfigs(generalClusterConfigs);
}
Also used : StorageLocationView(com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView) AdlsGen2FileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.adlsgen2.AdlsGen2FileSystemConfigurationsView) GeneralClusterConfigs(com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs) AdlsGen2FileSystem(com.sequenceiq.common.api.filesystem.AdlsGen2FileSystem) ArrayList(java.util.ArrayList) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView)

Example 2 with GeneralClusterConfigs

use of com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs in project cloudbreak by hortonworks.

the class RangerRazBaseConfigProviderTest method getServiceTypesConfigWheAGCPAnd729ShouldNOTAddProperty.

@Test
public void getServiceTypesConfigWheAGCPAnd729ShouldNOTAddProperty() {
    BlueprintTextProcessor blueprintTextProcessor = mock(BlueprintTextProcessor.class);
    when(blueprintTextProcessor.getVersion()).thenReturn(Optional.of("7.2.9"));
    TemplatePreparationObject preparationObject = TemplatePreparationObject.Builder.builder().withStackType(StackType.WORKLOAD).withBlueprintView(new BlueprintView("", "7.2.9", "CDH", blueprintTextProcessor)).withCloudPlatform(CloudPlatform.GCP).withGeneralClusterConfigs(new GeneralClusterConfigs()).withDataLakeView(new DatalakeView(false)).build();
    List<ApiClusterTemplateConfig> roleConfigs = underTest.getRoleConfigs("", preparationObject);
    assertEquals(0, roleConfigs.size());
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) GeneralClusterConfigs(com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs) BlueprintTextProcessor(com.sequenceiq.cloudbreak.template.processor.BlueprintTextProcessor) BlueprintView(com.sequenceiq.cloudbreak.template.views.BlueprintView) DatalakeView(com.sequenceiq.cloudbreak.template.views.DatalakeView) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) Test(org.junit.jupiter.api.Test)

Example 3 with GeneralClusterConfigs

use of com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs in project cloudbreak by hortonworks.

the class RangerRazBaseConfigProviderTest method getServiceTypesConfigWheAWSAnd7210ShouldAddProperty.

@Test
public void getServiceTypesConfigWheAWSAnd7210ShouldAddProperty() {
    BlueprintTextProcessor blueprintTextProcessor = mock(BlueprintTextProcessor.class);
    when(blueprintTextProcessor.getVersion()).thenReturn(Optional.of("7.2.10"));
    TemplatePreparationObject preparationObject = TemplatePreparationObject.Builder.builder().withStackType(StackType.WORKLOAD).withBlueprintView(new BlueprintView("", "7.2.10", "CDH", blueprintTextProcessor)).withCloudPlatform(CloudPlatform.AWS).withGeneralClusterConfigs(new GeneralClusterConfigs()).withDataLakeView(new DatalakeView(false)).build();
    List<ApiClusterTemplateConfig> roleConfigs = underTest.getRoleConfigs("", preparationObject);
    assertEquals(1, roleConfigs.size());
    assertEquals("<property><name>ranger.raz.bootstrap.servicetypes</name><value>s3</value></property>", roleConfigs.get(0).getValue());
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) GeneralClusterConfigs(com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs) BlueprintTextProcessor(com.sequenceiq.cloudbreak.template.processor.BlueprintTextProcessor) BlueprintView(com.sequenceiq.cloudbreak.template.views.BlueprintView) DatalakeView(com.sequenceiq.cloudbreak.template.views.DatalakeView) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) Test(org.junit.jupiter.api.Test)

Example 4 with GeneralClusterConfigs

use of com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs in project cloudbreak by hortonworks.

the class RangerRazBaseConfigProviderTest method getServiceTypesConfigWheAzureAnd7210ShouldAddProperty.

@Test
public void getServiceTypesConfigWheAzureAnd7210ShouldAddProperty() {
    BlueprintTextProcessor blueprintTextProcessor = mock(BlueprintTextProcessor.class);
    when(blueprintTextProcessor.getVersion()).thenReturn(Optional.of("7.2.10"));
    TemplatePreparationObject preparationObject = TemplatePreparationObject.Builder.builder().withStackType(StackType.WORKLOAD).withBlueprintView(new BlueprintView("", "7.2.10", "CDH", blueprintTextProcessor)).withCloudPlatform(CloudPlatform.AZURE).withGeneralClusterConfigs(new GeneralClusterConfigs()).withDataLakeView(new DatalakeView(false)).build();
    List<ApiClusterTemplateConfig> roleConfigs = underTest.getRoleConfigs("", preparationObject);
    assertEquals(1, roleConfigs.size());
    assertEquals("<property><name>ranger.raz.bootstrap.servicetypes</name><value>adls</value></property>", roleConfigs.get(0).getValue());
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) GeneralClusterConfigs(com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs) BlueprintTextProcessor(com.sequenceiq.cloudbreak.template.processor.BlueprintTextProcessor) BlueprintView(com.sequenceiq.cloudbreak.template.views.BlueprintView) DatalakeView(com.sequenceiq.cloudbreak.template.views.DatalakeView) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) Test(org.junit.jupiter.api.Test)

Example 5 with GeneralClusterConfigs

use of com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs in project cloudbreak by hortonworks.

the class RangerRazBaseConfigProviderTest method getServiceTypesConfigWheAzureAnd729ShouldNOTAddProperty.

@Test
public void getServiceTypesConfigWheAzureAnd729ShouldNOTAddProperty() {
    BlueprintTextProcessor blueprintTextProcessor = mock(BlueprintTextProcessor.class);
    when(blueprintTextProcessor.getVersion()).thenReturn(Optional.of("7.2.9"));
    TemplatePreparationObject preparationObject = TemplatePreparationObject.Builder.builder().withStackType(StackType.WORKLOAD).withBlueprintView(new BlueprintView("", "7.2.9", "CDH", blueprintTextProcessor)).withCloudPlatform(CloudPlatform.AZURE).withGeneralClusterConfigs(new GeneralClusterConfigs()).withDataLakeView(new DatalakeView(false)).build();
    List<ApiClusterTemplateConfig> roleConfigs = underTest.getRoleConfigs("", preparationObject);
    assertEquals(0, roleConfigs.size());
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) GeneralClusterConfigs(com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs) BlueprintTextProcessor(com.sequenceiq.cloudbreak.template.processor.BlueprintTextProcessor) BlueprintView(com.sequenceiq.cloudbreak.template.views.BlueprintView) DatalakeView(com.sequenceiq.cloudbreak.template.views.DatalakeView) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) Test(org.junit.jupiter.api.Test)

Aggregations

GeneralClusterConfigs (com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs)67 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)52 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)28 HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)21 Test (org.junit.jupiter.api.Test)20 BlueprintView (com.sequenceiq.cloudbreak.template.views.BlueprintView)19 Test (org.junit.Test)18 ApiClusterTemplateService (com.cloudera.api.swagger.model.ApiClusterTemplateService)16 DisplayName (org.junit.jupiter.api.DisplayName)16 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)16 ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)15 MethodSource (org.junit.jupiter.params.provider.MethodSource)13 DatalakeView (com.sequenceiq.cloudbreak.template.views.DatalakeView)12 BlueprintTextProcessor (com.sequenceiq.cloudbreak.template.processor.BlueprintTextProcessor)11 Gateway (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway)10 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)10 HashSet (java.util.HashSet)8 VirtualGroupRequest (com.sequenceiq.cloudbreak.auth.altus.VirtualGroupRequest)7 ArrayList (java.util.ArrayList)7 HostsResourceApi (com.cloudera.api.swagger.HostsResourceApi)6