Search in sources :

Example 1 with PlacementView

use of com.sequenceiq.cloudbreak.template.views.PlacementView in project cloudbreak by hortonworks.

the class StackV4RequestToTemplatePreparationObjectConverter method decorateBuilderWithPlacement.

private void decorateBuilderWithPlacement(StackV4Request source, Builder builder) {
    PlacementSettingsV4Request placementSettings = source.getPlacement();
    if (placementSettings != null) {
        String region = placementSettings.getRegion();
        builder.withPlacementView(new PlacementView(region, region));
    }
}
Also used : PlacementSettingsV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.environment.placement.PlacementSettingsV4Request) PlacementView(com.sequenceiq.cloudbreak.template.views.PlacementView)

Example 2 with PlacementView

use of com.sequenceiq.cloudbreak.template.views.PlacementView in project cloudbreak by hortonworks.

the class S3ConfigProviderTest method getTemplatePreparationObject.

private TemplatePreparationObject getTemplatePreparationObject(boolean useS3FileSystem, boolean fillDynamoTableName, boolean includeLocations) {
    HostgroupView master = new HostgroupView("master", 1, InstanceGroupType.GATEWAY, 1);
    HostgroupView worker = new HostgroupView("worker", 2, InstanceGroupType.CORE, 2);
    List<StorageLocationView> locations = new ArrayList<>();
    if (includeLocations) {
        locations.add(new StorageLocationView(getStorageLocation("hive.metastore.warehouse.dir", "s3a://bucket-first/warehouse/managed")));
        locations.add(new StorageLocationView(getStorageLocation("hive.metastore.warehouse.external.dir", "s3a://bucket-first/warehouse/external")));
        locations.add(new StorageLocationView(getStorageLocation("ranger_plugin_hdfs_audit_url", "s3a://bucket-second/ranger/audit")));
    }
    BaseFileSystemConfigurationsView fileSystemConfigurationsView;
    if (useS3FileSystem) {
        S3FileSystem s3FileSystem = new S3FileSystem();
        if (fillDynamoTableName) {
            s3FileSystem.setS3GuardDynamoTableName("dynamoTable");
        }
        fileSystemConfigurationsView = new S3FileSystemConfigurationsView(s3FileSystem, locations, false);
    } else {
        fileSystemConfigurationsView = new AdlsFileSystemConfigurationsView(new AdlsFileSystem(), locations, false);
    }
    Gateway gateway = TestUtil.gatewayEnabledWithExposedKnoxServices("NAMENODE");
    PlacementView placementView = new PlacementView("region", "az");
    return Builder.builder().withFileSystemConfigurationView(fileSystemConfigurationsView).withHostgroupViews(Set.of(master, worker)).withGateway(gateway, "/cb/secret/signkey", new HashSet<>()).withPlacementView(placementView).withDefaultTags(Map.of("apple", "apple1")).build();
}
Also used : StorageLocationView(com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView) BaseFileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView) Gateway(com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway) ArrayList(java.util.ArrayList) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) AdlsFileSystem(com.sequenceiq.common.api.filesystem.AdlsFileSystem) PlacementView(com.sequenceiq.cloudbreak.template.views.PlacementView) S3FileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView) S3FileSystem(com.sequenceiq.common.api.filesystem.S3FileSystem) AdlsFileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.adls.AdlsFileSystemConfigurationsView) HashSet(java.util.HashSet)

Example 3 with PlacementView

use of com.sequenceiq.cloudbreak.template.views.PlacementView in project cloudbreak by hortonworks.

the class StackToTemplatePreparationObjectConverter method decorateBuilderWithPlacement.

private void decorateBuilderWithPlacement(Stack source, Builder builder) {
    String region = source.getRegion();
    String availabilityZone = source.getAvailabilityZone();
    builder.withPlacementView(new PlacementView(region, availabilityZone));
}
Also used : PlacementView(com.sequenceiq.cloudbreak.template.views.PlacementView)

Example 4 with PlacementView

use of com.sequenceiq.cloudbreak.template.views.PlacementView in project cloudbreak by hortonworks.

the class HdfsConfigProviderTest method getTemplatePreparationObject.

private TemplatePreparationObject getTemplatePreparationObject(boolean useS3FileSystem, boolean fillDynamoTableName, boolean includeLocations) {
    HostgroupView master = new HostgroupView("master", 1, InstanceGroupType.GATEWAY, 1);
    HostgroupView worker = new HostgroupView("worker", 2, InstanceGroupType.CORE, 2);
    List<StorageLocationView> locations = new ArrayList<>();
    if (includeLocations) {
        locations.add(new StorageLocationView(getStorageLocation("hive.metastore.warehouse.dir", "s3a://bucket/warehouse/managed")));
        locations.add(new StorageLocationView(getStorageLocation("hive.metastore.warehouse.external.dir", "s3a://bucket/warehouse/external")));
    }
    BaseFileSystemConfigurationsView fileSystemConfigurationsView;
    if (useS3FileSystem) {
        S3FileSystem s3FileSystem = new S3FileSystem();
        if (fillDynamoTableName) {
            s3FileSystem.setS3GuardDynamoTableName("dynamoTable");
        }
        fileSystemConfigurationsView = new S3FileSystemConfigurationsView(s3FileSystem, locations, false);
    } else {
        fileSystemConfigurationsView = new AdlsFileSystemConfigurationsView(new AdlsFileSystem(), locations, false);
    }
    Gateway gateway = TestUtil.gatewayEnabledWithExposedKnoxServices(ExposedServiceUtil.exposedService("NAMENODE").getKnoxService());
    PlacementView placementView = new PlacementView("region", "az");
    return Builder.builder().withFileSystemConfigurationView(fileSystemConfigurationsView).withHostgroupViews(Set.of(master, worker)).withGateway(gateway, "/cb/secret/signkey", new HashSet<>()).withPlacementView(placementView).withDefaultTags(Map.of("apple", "apple1")).withProductDetails(new ClouderaManagerRepo().withVersion("7.1.0"), List.of()).withStackType(StackType.DATALAKE).build();
}
Also used : StorageLocationView(com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView) BaseFileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView) ArrayList(java.util.ArrayList) PlacementView(com.sequenceiq.cloudbreak.template.views.PlacementView) S3FileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView) S3FileSystem(com.sequenceiq.common.api.filesystem.S3FileSystem) ClouderaManagerRepo(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo) Gateway(com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) AdlsFileSystem(com.sequenceiq.common.api.filesystem.AdlsFileSystem) AdlsFileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.adls.AdlsFileSystemConfigurationsView) HashSet(java.util.HashSet)

Aggregations

PlacementView (com.sequenceiq.cloudbreak.template.views.PlacementView)4 Gateway (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway)2 BaseFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView)2 StorageLocationView (com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView)2 AdlsFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.adls.AdlsFileSystemConfigurationsView)2 S3FileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView)2 HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)2 AdlsFileSystem (com.sequenceiq.common.api.filesystem.AdlsFileSystem)2 S3FileSystem (com.sequenceiq.common.api.filesystem.S3FileSystem)2 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 PlacementSettingsV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.environment.placement.PlacementSettingsV4Request)1 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)1