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