Search in sources :

Example 11 with FileSystemType

use of com.sequenceiq.common.model.FileSystemType in project cloudbreak by hortonworks.

the class CloudStorageManifester method addIdBrokerIdentity.

private void addIdBrokerIdentity(SdxCloudStorageRequest cloudStorage, CloudStorageRequest cloudStorageRequest) {
    StorageIdentityBase idBroker = new StorageIdentityBase();
    idBroker.setType(CloudIdentityType.ID_BROKER);
    FileSystemType fileSystemType = cloudStorage.getFileSystemType();
    if (isFileSystemConfigured(fileSystemType)) {
        if (fileSystemType.isS3()) {
            idBroker.setS3(cloudStorage.getS3());
        } else if (fileSystemType.isWasb()) {
            idBroker.setWasb(cloudStorage.getWasb());
        } else if (fileSystemType.isAdlsGen2()) {
            idBroker.setAdlsGen2(cloudStorage.getAdlsGen2());
        } else if (fileSystemType.isGcs()) {
            idBroker.setGcs(cloudStorage.getGcs());
        }
        cloudStorageRequest.getIdentities().add(idBroker);
    }
}
Also used : FileSystemType(com.sequenceiq.common.model.FileSystemType) StorageIdentityBase(com.sequenceiq.common.api.cloudstorage.StorageIdentityBase)

Example 12 with FileSystemType

use of com.sequenceiq.common.model.FileSystemType in project cloudbreak by hortonworks.

the class CloudStorageConfigDetails method calculateStorageName.

private String calculateStorageName(String storageName, String fileSystemTypeName) {
    FileSystemType fileSystemType = FileSystemType.valueOf(fileSystemTypeName);
    String postfix = fileSystemType.getPostFix();
    if (StringUtils.isEmpty(postfix)) {
        return storageName;
    } else {
        return StringUtils.substringBefore(storageName, postfix);
    }
}
Also used : FileSystemType(com.sequenceiq.common.model.FileSystemType)

Example 13 with FileSystemType

use of com.sequenceiq.common.model.FileSystemType in project cloudbreak by hortonworks.

the class CloudStorageConfigDetails method calculateSubFolder.

private String calculateSubFolder(String storageName, String fileSystemTypeName) {
    FileSystemType fileSystemType = FileSystemType.valueOf(fileSystemTypeName);
    String postfix = fileSystemType.getPostFix();
    if (StringUtils.isEmpty(postfix)) {
        return "";
    } else {
        return StringUtils.substringAfter(storageName, postfix);
    }
}
Also used : FileSystemType(com.sequenceiq.common.model.FileSystemType)

Aggregations

FileSystemType (com.sequenceiq.common.model.FileSystemType)13 CloudFileSystemView (com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudFileSystemView)4 SpiFileSystem (com.sequenceiq.cloudbreak.cloud.model.SpiFileSystem)3 StorageIdentityBase (com.sequenceiq.common.api.cloudstorage.StorageIdentityBase)3 CloudCredential (com.sequenceiq.cloudbreak.cloud.model.CloudCredential)2 ObjectStorageMetadataRequest (com.sequenceiq.cloudbreak.cloud.model.objectstorage.ObjectStorageMetadataRequest)2 ObjectStorageMetadataResponse (com.sequenceiq.cloudbreak.cloud.model.objectstorage.ObjectStorageMetadataResponse)2 FileSystem (com.sequenceiq.cloudbreak.domain.FileSystem)2 CloudIdentity (com.sequenceiq.cloudbreak.domain.cloudstorage.CloudIdentity)2 CloudStorage (com.sequenceiq.cloudbreak.domain.cloudstorage.CloudStorage)2 StorageLocation (com.sequenceiq.cloudbreak.domain.cloudstorage.StorageLocation)2 CloudStorageRequest (com.sequenceiq.common.api.cloudstorage.CloudStorageRequest)2 AdlsGen2CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters)2 WasbCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.WasbCloudStorageV1Parameters)2 ConfigQueryEntry (com.sequenceiq.common.api.cloudstorage.query.ConfigQueryEntry)2 CloudStorageCdpService (com.sequenceiq.common.model.CloudStorageCdpService)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1