Search in sources :

Example 1 with WasbCloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.WasbCloudStorageV1Parameters in project cloudbreak by hortonworks.

the class WasbFileSystemToWasbCloudStorageParametersConverterTest method testConvertCheckEveryParameterHasPassedProperly.

@Test
public void testConvertCheckEveryParameterHasPassedProperly() {
    WasbCloudStorageV1Parameters expected = new WasbCloudStorageV1Parameters();
    expected.setAccountKey(TEST_ACCOUNT_KEY);
    expected.setAccountName(TEST_ACCOUNT_NAME);
    WasbCloudStorageV1Parameters result = underTest.convert(createWasbFileSystem());
    assertEquals(expected, result);
}
Also used : WasbCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.WasbCloudStorageV1Parameters) Test(org.junit.Test)

Example 2 with WasbCloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.WasbCloudStorageV1Parameters in project cloudbreak by hortonworks.

the class AzureCloudProvider method getFileSystemType.

@Override
public FileSystemType getFileSystemType() {
    AdlsCloudStorageV1Parameters adlsCloudStorageV1Parameters = new AdlsCloudStorageV1Parameters();
    AdlsGen2CloudStorageV1Parameters adlsGen2CloudStorageV1Parameters = new AdlsGen2CloudStorageV1Parameters();
    WasbCloudStorageV1Parameters wasbCloudStorageV1Parameters = new WasbCloudStorageV1Parameters();
    FileSystemType fileSystemType;
    switch(azureProperties.getCloudStorage().getFileSystemType()) {
        case "WASB_INTEGRATED":
        case "WASB":
            fileSystemType = wasbCloudStorageV1Parameters.getType();
            break;
        case "ADLS":
            fileSystemType = adlsCloudStorageV1Parameters.getType();
            break;
        case "ADLS_GEN_2":
            fileSystemType = adlsGen2CloudStorageV1Parameters.getType();
            break;
        default:
            LOGGER.warn("The given {} File System Type is not in the list of Azure file system types. So we use the default one; {}", azureProperties.getCloudStorage().getFileSystemType(), "ADLS_GEN_2");
            fileSystemType = adlsGen2CloudStorageV1Parameters.getType();
            break;
    }
    return fileSystemType;
}
Also used : AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) WasbCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.WasbCloudStorageV1Parameters) AdlsCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsCloudStorageV1Parameters) FileSystemType(com.sequenceiq.common.model.FileSystemType)

Example 3 with WasbCloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.WasbCloudStorageV1Parameters in project cloudbreak by hortonworks.

the class CloudStorageValidationUtilTest method testIsCloudStorageConfiguredWhenWasbNotNull.

@Test
public void testIsCloudStorageConfiguredWhenWasbNotNull() {
    CloudStorageRequest cloudStorageRequest = new CloudStorageRequest();
    StorageIdentityBase storageIdentityBase = new StorageIdentityBase();
    storageIdentityBase.setWasb(new WasbCloudStorageV1Parameters());
    cloudStorageRequest.setIdentities(List.of(storageIdentityBase));
    cloudStorageRequest.setLocations(List.of(new StorageLocationBase()));
    boolean actual = underTest.isCloudStorageConfigured(cloudStorageRequest);
    Assert.assertTrue(actual);
}
Also used : CloudStorageRequest(com.sequenceiq.common.api.cloudstorage.CloudStorageRequest) WasbCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.WasbCloudStorageV1Parameters) StorageIdentityBase(com.sequenceiq.common.api.cloudstorage.StorageIdentityBase) StorageLocationBase(com.sequenceiq.common.api.cloudstorage.StorageLocationBase) Test(org.junit.Test)

Example 4 with WasbCloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.WasbCloudStorageV1Parameters in project cloudbreak by hortonworks.

the class CloudStorageConverter method cloudIdentityToStorageIdentityBase.

private StorageIdentityBase cloudIdentityToStorageIdentityBase(CloudIdentity cloudIdentity) {
    StorageIdentityBase storageIdentityBase = new StorageIdentityBase();
    storageIdentityBase.setType(cloudIdentity.getIdentityType());
    if (cloudIdentity.getWasbIdentity() != null) {
        WasbCloudStorageV1Parameters parameters = wasbIdentityToParameters(cloudIdentity.getWasbIdentity());
        storageIdentityBase.setWasb(parameters);
    } else if (cloudIdentity.getS3Identity() != null) {
        S3CloudStorageV1Parameters parameters = s3IdentityToParameters(cloudIdentity.getS3Identity());
        storageIdentityBase.setS3(parameters);
    } else if (cloudIdentity.getAdlsGen2Identity() != null) {
        AdlsGen2CloudStorageV1Parameters adlsGen2CloudStorageV1Parameters = adlsGen2IdentityToParameters(cloudIdentity.getAdlsGen2Identity());
        storageIdentityBase.setAdlsGen2(adlsGen2CloudStorageV1Parameters);
    } else if (cloudIdentity.getGcsIdentity() != null) {
        GcsCloudStorageV1Parameters gcsCloudStorageV1Parameters = gcsIdentityToParameters(cloudIdentity.getGcsIdentity());
        storageIdentityBase.setGcs(gcsCloudStorageV1Parameters);
    }
    return storageIdentityBase;
}
Also used : S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) WasbCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.WasbCloudStorageV1Parameters) GcsCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters) StorageIdentityBase(com.sequenceiq.common.api.cloudstorage.StorageIdentityBase)

Example 5 with WasbCloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.WasbCloudStorageV1Parameters in project cloudbreak by hortonworks.

the class CloudStorageConverter method wasbIdentityToParameters.

private WasbCloudStorageV1Parameters wasbIdentityToParameters(WasbIdentity wasbIdentity) {
    WasbCloudStorageV1Parameters wasbParameters = new WasbCloudStorageV1Parameters();
    wasbParameters.setAccountKey(wasbIdentity.getAccountKey());
    wasbParameters.setAccountName(wasbIdentity.getAccountName());
    wasbParameters.setSecure(wasbIdentity.isSecure());
    return wasbParameters;
}
Also used : WasbCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.WasbCloudStorageV1Parameters)

Aggregations

WasbCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.WasbCloudStorageV1Parameters)7 StorageIdentityBase (com.sequenceiq.common.api.cloudstorage.StorageIdentityBase)3 AdlsGen2CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters)3 GcsCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)2 S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)2 Test (org.junit.Test)2 CloudStorageRequest (com.sequenceiq.common.api.cloudstorage.CloudStorageRequest)1 StorageLocationBase (com.sequenceiq.common.api.cloudstorage.StorageLocationBase)1 AdlsCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.AdlsCloudStorageV1Parameters)1 FileSystemType (com.sequenceiq.common.model.FileSystemType)1