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