Search in sources :

Example 1 with EfsFileSystem

use of com.sequenceiq.common.api.filesystem.EfsFileSystem 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)

Aggregations

CloudFileSystemView (com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudFileSystemView)1 AdlsFileSystem (com.sequenceiq.common.api.filesystem.AdlsFileSystem)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 S3FileSystem (com.sequenceiq.common.api.filesystem.S3FileSystem)1 WasbFileSystem (com.sequenceiq.common.api.filesystem.WasbFileSystem)1 IOException (java.io.IOException)1