Search in sources :

Example 16 with StorageLocationView

use of com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView 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)

Example 17 with StorageLocationView

use of com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView in project cloudbreak by hortonworks.

the class HiveOnTezServiceConfigProviderTest method getTemplatePreparationObject.

private TemplatePreparationObject getTemplatePreparationObject(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) {
        StorageLocation hmsExternalWarehouseDir = new StorageLocation();
        hmsExternalWarehouseDir.setProperty("hive.metastore.warehouse.external.dir");
        hmsExternalWarehouseDir.setValue("s3a://bucket/hive/warehouse/external");
        locations.add(new StorageLocationView(hmsExternalWarehouseDir));
    }
    S3FileSystemConfigurationsView fileSystemConfigurationsView = new S3FileSystemConfigurationsView(new S3FileSystem(), locations, false);
    return Builder.builder().withFileSystemConfigurationView(fileSystemConfigurationsView).withHostgroupViews(Set.of(master, worker)).build();
}
Also used : StorageLocationView(com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView) ArrayList(java.util.ArrayList) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) StorageLocation(com.sequenceiq.cloudbreak.domain.StorageLocation) S3FileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView) S3FileSystem(com.sequenceiq.common.api.filesystem.S3FileSystem)

Example 18 with StorageLocationView

use of com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView in project cloudbreak by hortonworks.

the class ProfilerAdminCloudStorageRoleConfigProviderTest method getTemplatePreparationObject.

private TemplatePreparationObject getTemplatePreparationObject(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(getProfilerAdminFileSystemUri()));
    }
    S3FileSystemConfigurationsView fileSystemConfigurationsView = new S3FileSystemConfigurationsView(new S3FileSystem(), locations, false);
    return Builder.builder().withFileSystemConfigurationView(fileSystemConfigurationsView).withHostgroupViews(Set.of(master, worker)).build();
}
Also used : StorageLocationView(com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView) ArrayList(java.util.ArrayList) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) S3FileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView) S3FileSystem(com.sequenceiq.common.api.filesystem.S3FileSystem)

Example 19 with StorageLocationView

use of com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView in project cloudbreak by hortonworks.

the class ImpalaCloudStorageServiceConfigProviderTest method getTemplatePreparationObject.

private TemplatePreparationObject getTemplatePreparationObject(boolean includeLocations) {
    HostgroupView master = new HostgroupView("master", 1, InstanceGroupType.GATEWAY, 1);
    HostgroupView coordinator = new HostgroupView("coordinator", 1, InstanceGroupType.CORE, 1);
    HostgroupView executor = new HostgroupView("executor", 2, InstanceGroupType.CORE, 2);
    List<StorageLocationView> locations = new ArrayList<>();
    if (includeLocations) {
        locations.add(new StorageLocationView(getHiveWarehouseStorageLocation()));
        locations.add(new StorageLocationView(getHiveWarehouseExternalStorageLocation()));
    }
    S3FileSystemConfigurationsView fileSystemConfigurationsView = new S3FileSystemConfigurationsView(new S3FileSystem(), locations, false);
    return Builder.builder().withFileSystemConfigurationView(fileSystemConfigurationsView).withHostgroupViews(Set.of(master, coordinator, executor)).build();
}
Also used : StorageLocationView(com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView) ArrayList(java.util.ArrayList) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) S3FileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView) S3FileSystem(com.sequenceiq.common.api.filesystem.S3FileSystem)

Example 20 with StorageLocationView

use of com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView in project cloudbreak by hortonworks.

the class CoreConfigProviderTest method isConfigurationNeededWhenNotPresentedHdfsNotAndStorageConfiguredMustReturnTrue.

@Test
public void isConfigurationNeededWhenNotPresentedHdfsNotAndStorageConfiguredMustReturnTrue() {
    CmTemplateProcessor mockTemplateProcessor = mock(CmTemplateProcessor.class);
    TemplatePreparationObject templatePreparationObject = mock(TemplatePreparationObject.class);
    BaseFileSystemConfigurationsView fileSystemConfiguration = mock(BaseFileSystemConfigurationsView.class);
    List<StorageLocationView> storageLocationViews = new ArrayList<>();
    StorageLocation storageLocation = new StorageLocation();
    storageLocation.setConfigFile("core_defaultfs1");
    storageLocation.setProperty("core_defaultfs1");
    storageLocation.setValue("s3a://default-bucket/");
    storageLocationViews.add(new StorageLocationView(storageLocation));
    when(fileSystemConfiguration.getLocations()).thenReturn(storageLocationViews);
    Optional<BaseFileSystemConfigurationsView> fileSystemConfigurationView = Optional.of(fileSystemConfiguration);
    when(mockTemplateProcessor.isRoleTypePresentInService(HDFS, List.of(NAMENODE))).thenReturn(false);
    when(templatePreparationObject.getFileSystemConfigurationView()).thenReturn(fileSystemConfigurationView);
    Assert.assertFalse(underTest.isConfigurationNeeded(mockTemplateProcessor, templatePreparationObject));
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) StorageLocationView(com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView) BaseFileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView) ArrayList(java.util.ArrayList) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) StorageLocation(com.sequenceiq.cloudbreak.domain.StorageLocation) Test(org.junit.Test)

Aggregations

StorageLocationView (com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView)28 ArrayList (java.util.ArrayList)24 S3FileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView)22 S3FileSystem (com.sequenceiq.common.api.filesystem.S3FileSystem)22 HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)19 StorageLocation (com.sequenceiq.cloudbreak.domain.StorageLocation)16 BaseFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView)7 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)5 Test (org.junit.Test)5 CmTemplateProcessor (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor)4 Gateway (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway)3 GeneralClusterConfigs (com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs)3 HashSet (java.util.HashSet)3 ApiClusterTemplate (com.cloudera.api.swagger.model.ApiClusterTemplate)2 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)2 AdlsFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.adls.AdlsFileSystemConfigurationsView)2 AdlsGen2FileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.adlsgen2.AdlsGen2FileSystemConfigurationsView)2 PlacementView (com.sequenceiq.cloudbreak.template.views.PlacementView)2 BackupResponse (com.sequenceiq.common.api.backup.response.BackupResponse)2 AdlsFileSystem (com.sequenceiq.common.api.filesystem.AdlsFileSystem)2