use of com.sequenceiq.cloudbreak.template.filesystem.adls.AdlsFileSystemConfigurationsView in project cloudbreak by hortonworks.
the class AbstractFileSystemConfiguratorTest method testGetScriptsWhenFileNotFound.
@Test
public void testGetScriptsWhenFileNotFound() {
Credential credential = Credential.builder().crn("crn2").build();
AdlsFileSystemConfigurationsView adlsFileSystemConfigurationsView = new AdlsFileSystemConfigurationsView(adlsFileSystem(), new HashSet<>(), false);
thrown.expectMessage("Filesystem configuration scripts cannot be read.");
thrown.expect(FileSystemConfigException.class);
underTest.getScripts(credential, adlsFileSystemConfigurationsView);
}
use of com.sequenceiq.cloudbreak.template.filesystem.adls.AdlsFileSystemConfigurationsView in project cloudbreak by hortonworks.
the class AbstractFileSystemConfiguratorTest method testDelteResource.
@Test
public void testDelteResource() {
AdlsFileSystemConfigurationsView adlsFileSystemConfigurationsView = new AdlsFileSystemConfigurationsView(adlsFileSystem(), new HashSet<>(), false);
Map<String, String> actual = underTest.deleteResources(adlsFileSystemConfigurationsView);
Assert.assertEquals(emptyMap(), actual);
}
use of com.sequenceiq.cloudbreak.template.filesystem.adls.AdlsFileSystemConfigurationsView in project cloudbreak by hortonworks.
the class AbstractFileSystemConfiguratorTest method testGetScripts.
@Test
public void testGetScripts() {
Credential credential = Credential.builder().crn("crn0").build();
AdlsFileSystemConfigurationsView adlsFileSystemConfigurationsView = new AdlsFileSystemConfigurationsView(adlsFileSystem(), new HashSet<>(), false);
List<RecipeScript> actual = underTest.getScripts(credential, adlsFileSystemConfigurationsView);
List<RecipeScript> expected = singletonList(new RecipeScript("echo 'newContent'", ExecutionType.ALL_NODES, RecipeType.POST_CLOUDERA_MANAGER_START));
Assert.assertEquals(expected, actual);
}
use of com.sequenceiq.cloudbreak.template.filesystem.adls.AdlsFileSystemConfigurationsView 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();
}
Aggregations