Search in sources :

Example 1 with AdlsFileSystem

use of com.sequenceiq.common.api.filesystem.AdlsFileSystem in project cloudbreak by hortonworks.

the class CloudStorageParametersConverter method adlsParametersToFileSystem.

public AdlsFileSystem adlsParametersToFileSystem(AdlsCloudStorageV1Parameters source) {
    AdlsFileSystem fileSystemConfigurations = new AdlsFileSystem();
    fileSystemConfigurations.setClientId(source.getClientId());
    fileSystemConfigurations.setAccountName(source.getAccountName());
    fileSystemConfigurations.setCredential(source.getCredential());
    fileSystemConfigurations.setTenantId(source.getTenantId());
    return fileSystemConfigurations;
}
Also used : AdlsFileSystem(com.sequenceiq.common.api.filesystem.AdlsFileSystem)

Example 2 with AdlsFileSystem

use of com.sequenceiq.common.api.filesystem.AdlsFileSystem in project cloudbreak by hortonworks.

the class S3ConfigProviderTest 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-first/warehouse/managed")));
        locations.add(new StorageLocationView(getStorageLocation("hive.metastore.warehouse.external.dir", "s3a://bucket-first/warehouse/external")));
        locations.add(new StorageLocationView(getStorageLocation("ranger_plugin_hdfs_audit_url", "s3a://bucket-second/ranger/audit")));
    }
    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("NAMENODE");
    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")).build();
}
Also used : StorageLocationView(com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView) BaseFileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView) Gateway(com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway) ArrayList(java.util.ArrayList) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) AdlsFileSystem(com.sequenceiq.common.api.filesystem.AdlsFileSystem) PlacementView(com.sequenceiq.cloudbreak.template.views.PlacementView) S3FileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView) S3FileSystem(com.sequenceiq.common.api.filesystem.S3FileSystem) AdlsFileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.adls.AdlsFileSystemConfigurationsView) HashSet(java.util.HashSet)

Example 3 with AdlsFileSystem

use of com.sequenceiq.common.api.filesystem.AdlsFileSystem in project cloudbreak by hortonworks.

the class TemplateCoreTestUtil method adlsFileSystem.

public static AdlsFileSystem adlsFileSystem() {
    AdlsFileSystem adlsFileSystem = new AdlsFileSystem();
    adlsFileSystem.setClientId("clientid");
    adlsFileSystem.setAccountName("accountname");
    adlsFileSystem.setCredential("1");
    adlsFileSystem.setTenantId("tenantid");
    return adlsFileSystem;
}
Also used : AdlsFileSystem(com.sequenceiq.common.api.filesystem.AdlsFileSystem)

Example 4 with AdlsFileSystem

use of com.sequenceiq.common.api.filesystem.AdlsFileSystem in project cloudbreak by hortonworks.

the class FileSystemConverter method legacyConvertFromConfiguration.

private List<CloudFileSystemView> legacyConvertFromConfiguration(FileSystem source) {
    try {
        CloudFileSystemView fileSystemView;
        if (source.getType().isAdls()) {
            AdlsFileSystem adlsFileSystem = source.getConfigurations().get(AdlsFileSystem.class);
            fileSystemView = convertAdlsLegacy(adlsFileSystem);
        } else if (source.getType().isGcs()) {
            GcsFileSystem gcsFileSystem = source.getConfigurations().get(GcsFileSystem.class);
            fileSystemView = convertGcsLegacy(gcsFileSystem);
        } else if (source.getType().isS3()) {
            S3FileSystem s3FileSystem = source.getConfigurations().get(S3FileSystem.class);
            fileSystemView = convertS3Legacy(s3FileSystem);
        } else if (source.getType().isEfs()) {
            EfsFileSystem efsFileSystem = source.getConfigurations().get(EfsFileSystem.class);
            fileSystemView = convertEfsLegacy(efsFileSystem);
        } else if (source.getType().isWasb()) {
            WasbFileSystem wasbFileSystem = source.getConfigurations().get(WasbFileSystem.class);
            fileSystemView = convertWasbLegacy(wasbFileSystem);
        } else if (source.getType().isAdlsGen2()) {
            AdlsGen2FileSystem adlsGen2FileSystem = source.getConfigurations().get(AdlsGen2FileSystem.class);
            fileSystemView = convertAdlsGen2Legacy(adlsGen2FileSystem);
        } else if (source.getType().isGcs()) {
            GcsFileSystem gcsFileSystem = source.getConfigurations().get(GcsFileSystem.class);
            fileSystemView = convertGcsLegacy(gcsFileSystem);
        } else {
            return Collections.emptyList();
        }
        return List.of(fileSystemView);
    } catch (IOException e) {
        LOGGER.warn("Error occurred when tried to convert filesystem object: {}", e.getMessage());
    }
    return Collections.emptyList();
}
Also used : GcsFileSystem(com.sequenceiq.common.api.filesystem.GcsFileSystem) AdlsGen2FileSystem(com.sequenceiq.common.api.filesystem.AdlsGen2FileSystem) CloudFileSystemView(com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudFileSystemView) IOException(java.io.IOException) EfsFileSystem(com.sequenceiq.common.api.filesystem.EfsFileSystem) AdlsFileSystem(com.sequenceiq.common.api.filesystem.AdlsFileSystem) WasbFileSystem(com.sequenceiq.common.api.filesystem.WasbFileSystem) S3FileSystem(com.sequenceiq.common.api.filesystem.S3FileSystem)

Example 5 with AdlsFileSystem

use of com.sequenceiq.common.api.filesystem.AdlsFileSystem in project cloudbreak by hortonworks.

the class CloudStorageParametersConverter method adlsToFileSystem.

public AdlsFileSystem adlsToFileSystem(AdlsCloudStorageV1Parameters source) {
    AdlsFileSystem fileSystemConfigurations = new AdlsFileSystem();
    fileSystemConfigurations.setClientId(source.getClientId());
    fileSystemConfigurations.setAccountName(source.getAccountName());
    fileSystemConfigurations.setCredential(source.getCredential());
    fileSystemConfigurations.setTenantId(source.getTenantId());
    return fileSystemConfigurations;
}
Also used : AdlsFileSystem(com.sequenceiq.common.api.filesystem.AdlsFileSystem)

Aggregations

AdlsFileSystem (com.sequenceiq.common.api.filesystem.AdlsFileSystem)6 S3FileSystem (com.sequenceiq.common.api.filesystem.S3FileSystem)3 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 AdlsFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.adls.AdlsFileSystemConfigurationsView)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 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)1 CloudFileSystemView (com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudFileSystemView)1 AdlsGen2FileSystem (com.sequenceiq.common.api.filesystem.AdlsGen2FileSystem)1 EfsFileSystem (com.sequenceiq.common.api.filesystem.EfsFileSystem)1 GcsFileSystem (com.sequenceiq.common.api.filesystem.GcsFileSystem)1 WasbFileSystem (com.sequenceiq.common.api.filesystem.WasbFileSystem)1 IOException (java.io.IOException)1