Search in sources :

Example 1 with DataLakeStorageAccountDetails

use of com.microsoft.azure.hdinsight.sdk.rest.azure.synapse.models.DataLakeStorageAccountDetails in project azure-tools-for-java by Microsoft.

the class ArcadiaSparkCompute method getStorageAccount.

@Nullable
@Override
public IHDIStorageAccount getStorageAccount() {
    DataLakeStorageAccountDetails storageAccountDetails = getWorkSpace().getStorageAccountDetails();
    if (storageAccountDetails == null || storageAccountDetails.accountUrl() == null || storageAccountDetails.filesystem() == null) {
        log().warn(String.format("Storage account info is invalid for workspace %s. AccountUrl: %s, filesystem: %s.", getWorkSpace().getName(), storageAccountDetails.accountUrl(), storageAccountDetails.filesystem()));
        return null;
    }
    // Sample response:
    // "accountUrl": "https://accountName.dfs.core.windows.net",
    // "filesystem": "fileSystemName"
    URI storageUri = AbfsUri.parse(storageAccountDetails.accountUrl() + "/" + storageAccountDetails.filesystem()).getUri();
    return new ADLSGen2StorageAccount(this, storageUri.getHost(), true, storageAccountDetails.filesystem());
}
Also used : ADLSGen2StorageAccount(com.microsoft.azure.hdinsight.sdk.storage.ADLSGen2StorageAccount) URI(java.net.URI) DataLakeStorageAccountDetails(com.microsoft.azure.hdinsight.sdk.rest.azure.synapse.models.DataLakeStorageAccountDetails) Nullable(com.microsoft.azuretools.azurecommons.helpers.Nullable)

Aggregations

DataLakeStorageAccountDetails (com.microsoft.azure.hdinsight.sdk.rest.azure.synapse.models.DataLakeStorageAccountDetails)1 ADLSGen2StorageAccount (com.microsoft.azure.hdinsight.sdk.storage.ADLSGen2StorageAccount)1 Nullable (com.microsoft.azuretools.azurecommons.helpers.Nullable)1 URI (java.net.URI)1