Search in sources :

Example 6 with AdlsFileSystemConfigurationsView

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);
}
Also used : Credential(com.sequenceiq.cloudbreak.dto.credential.Credential) AdlsFileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.adls.AdlsFileSystemConfigurationsView) Test(org.junit.Test)

Example 7 with 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);
}
Also used : AdlsFileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.adls.AdlsFileSystemConfigurationsView) Test(org.junit.Test)

Example 8 with AdlsFileSystemConfigurationsView

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);
}
Also used : Credential(com.sequenceiq.cloudbreak.dto.credential.Credential) RecipeScript(com.sequenceiq.cloudbreak.common.model.recipe.RecipeScript) AdlsFileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.adls.AdlsFileSystemConfigurationsView) Test(org.junit.Test)

Example 9 with AdlsFileSystemConfigurationsView

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

Aggregations

AdlsFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.adls.AdlsFileSystemConfigurationsView)9 Test (org.junit.Test)5 Credential (com.sequenceiq.cloudbreak.dto.credential.Credential)3 RecipeScript (com.sequenceiq.cloudbreak.common.model.recipe.RecipeScript)2 Gateway (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway)2 BaseFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView)2 StorageLocationView (com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView)2 S3FileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView)2 HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)2 PlacementView (com.sequenceiq.cloudbreak.template.views.PlacementView)2 AdlsFileSystem (com.sequenceiq.common.api.filesystem.AdlsFileSystem)2 S3FileSystem (com.sequenceiq.common.api.filesystem.S3FileSystem)2 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)1 WasbFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.wasb.WasbFileSystemConfigurationsView)1