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