Search in sources :

Example 31 with StorageLocation

use of com.sequenceiq.cloudbreak.domain.StorageLocation 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 32 with StorageLocation

use of com.sequenceiq.cloudbreak.domain.StorageLocation 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)

Example 33 with StorageLocation

use of com.sequenceiq.cloudbreak.domain.StorageLocation in project cloudbreak by hortonworks.

the class FlinkCloudStorageConfigProviderTest method getStorageLocationView.

private StorageLocationView getStorageLocationView(String property, String value) {
    StorageLocation storageLocation = new StorageLocation();
    storageLocation.setProperty(property);
    storageLocation.setValue(value);
    return new StorageLocationView(storageLocation);
}
Also used : StorageLocationView(com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView) StorageLocation(com.sequenceiq.cloudbreak.domain.StorageLocation)

Example 34 with StorageLocation

use of com.sequenceiq.cloudbreak.domain.StorageLocation in project cloudbreak by hortonworks.

the class AbstractHbaseConfigProviderTest method getTemplatePreparationObject.

protected TemplatePreparationObject getTemplatePreparationObject(boolean includeLocations, boolean datalakeCluster, String cdhVersion, Map<String, String> defaultTags, CloudPlatform cloudPlatform) {
    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 hbaseRootDir = new StorageLocation();
        hbaseRootDir.setProperty("hbase.rootdir");
        hbaseRootDir.setValue("s3a://bucket/cluster1/hbase");
        locations.add(new StorageLocationView(hbaseRootDir));
    }
    S3FileSystemConfigurationsView fileSystemConfigurationsView = new S3FileSystemConfigurationsView(new S3FileSystem(), locations, false);
    SharedServiceConfigsView sharedServicesConfigsView = new SharedServiceConfigsView();
    sharedServicesConfigsView.setDatalakeCluster(datalakeCluster);
    String inputJson = getBlueprintText("input/clouderamanager.bp");
    CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
    cmTemplateProcessor.setCdhVersion(cdhVersion);
    GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
    generalClusterConfigs.setAccountId(Optional.of("1234"));
    return TemplatePreparationObject.Builder.builder().withFileSystemConfigurationView(fileSystemConfigurationsView).withBlueprintView(new BlueprintView(inputJson, "", "", cmTemplateProcessor)).withSharedServiceConfigs(sharedServicesConfigsView).withHostgroupViews(Set.of(master, worker)).withGeneralClusterConfigs(generalClusterConfigs).withDefaultTags(defaultTags).withCloudPlatform(cloudPlatform).build();
}
Also used : StorageLocationView(com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView) GeneralClusterConfigs(com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs) BlueprintView(com.sequenceiq.cloudbreak.template.views.BlueprintView) ArrayList(java.util.ArrayList) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) StorageLocation(com.sequenceiq.cloudbreak.domain.StorageLocation) SharedServiceConfigsView(com.sequenceiq.cloudbreak.template.views.SharedServiceConfigsView) S3FileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView) S3FileSystem(com.sequenceiq.common.api.filesystem.S3FileSystem)

Example 35 with StorageLocation

use of com.sequenceiq.cloudbreak.domain.StorageLocation in project cloudbreak by hortonworks.

the class ProfilerMetricsCloudStorageRoleConfigProviderTest method getProfilerMetricsFileSystemUri.

private StorageLocation getProfilerMetricsFileSystemUri() {
    StorageLocation profilerMetricsFileSystemUri = new StorageLocation();
    profilerMetricsFileSystemUri.setProperty("file_system_uri");
    profilerMetricsFileSystemUri.setValue("s3a://bucket/dpprofiler");
    return profilerMetricsFileSystemUri;
}
Also used : StorageLocation(com.sequenceiq.cloudbreak.domain.StorageLocation)

Aggregations

StorageLocation (com.sequenceiq.cloudbreak.domain.StorageLocation)40 StorageLocationView (com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView)16 ArrayList (java.util.ArrayList)13 S3FileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView)11 S3FileSystem (com.sequenceiq.common.api.filesystem.S3FileSystem)11 HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)7 Test (org.junit.Test)6 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)5 BaseFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView)5 CmTemplateProcessor (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor)4 ApiClusterTemplate (com.cloudera.api.swagger.model.ApiClusterTemplate)2 BackupResponse (com.sequenceiq.common.api.backup.response.BackupResponse)2 HashSet (java.util.HashSet)2 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)2 ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)1 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)1 CoreConfigProvider (com.sequenceiq.cloudbreak.cmtemplate.configproviders.core.CoreConfigProvider)1 HiveMetastoreConfigProvider (com.sequenceiq.cloudbreak.cmtemplate.configproviders.hive.HiveMetastoreConfigProvider)1 Json (com.sequenceiq.cloudbreak.common.json.Json)1 FileSystem (com.sequenceiq.cloudbreak.domain.FileSystem)1