Search in sources :

Example 1 with DataLakeStoreAccountInformation

use of com.microsoft.azure.hdinsight.sdk.rest.azure.datalake.analytics.accounts.models.DataLakeStoreAccountInformation in project azure-tools-for-java by Microsoft.

the class AzureSparkServerlessAccount method getStorageRootPath.

@Nullable
public String getStorageRootPath() {
    String storageRootPath = null;
    DataLakeAnalyticsAccount accountDetail = this.getDetailResponse();
    if (accountDetail != null) {
        // find default storage account name and suffix
        String defaultStorageAccountName = accountDetail.defaultDataLakeStoreAccount();
        storageRootPath = accountDetail.dataLakeStoreAccounts().stream().filter(info -> info.name().equals(defaultStorageAccountName)).findFirst().map(DataLakeStoreAccountInformation::suffix).map(suffix -> String.format("adl://%s.%s/", defaultStorageAccountName, suffix)).orElse(null);
    }
    return storageRootPath;
}
Also used : AuthMethodManager(com.microsoft.azuretools.authmanage.AuthMethodManager) JobInfoListResult(com.microsoft.azure.hdinsight.sdk.rest.azure.datalake.analytics.job.models.JobInfoListResult) SparkSubmitStorageTypeOptionsForCluster(com.microsoft.azure.hdinsight.spark.common.SparkSubmitStorageTypeOptionsForCluster) NotNull(com.microsoft.azuretools.azurecommons.helpers.NotNull) ODataParam(com.microsoft.azure.hdinsight.sdk.common.ODataParam) DataLakeAnalyticsAccountBasic(com.microsoft.azure.hdinsight.sdk.rest.azure.datalake.analytics.accounts.models.DataLakeAnalyticsAccountBasic) SparkSubmitStorageType(com.microsoft.azure.hdinsight.spark.common.SparkSubmitStorageType) AzureManager(com.microsoft.azuretools.sdkmanage.AzureManager) ClusterContainer(com.microsoft.azure.hdinsight.sdk.cluster.ClusterContainer) AzureDataLakeHttpObservable(com.microsoft.azure.hdinsight.sdk.common.AzureDataLakeHttpObservable) StringUtils(org.apache.commons.lang3.StringUtils) ILogger(com.microsoft.azure.hdinsight.common.logger.ILogger) DataLakeAnalyticsAccount(com.microsoft.azure.hdinsight.sdk.rest.azure.datalake.analytics.accounts.models.DataLakeAnalyticsAccount) Observable(rx.Observable) ImmutableList(com.google.common.collect.ImmutableList) SubscriptionDetail(com.microsoft.azuretools.authmanage.models.SubscriptionDetail) URI(java.net.URI) JobState(com.microsoft.azure.hdinsight.sdk.rest.azure.datalake.analytics.job.models.JobState) IClusterDetail(com.microsoft.azure.hdinsight.sdk.cluster.IClusterDetail) ImmutableSortedSet(com.google.common.collect.ImmutableSortedSet) Nullable(com.microsoft.azuretools.azurecommons.helpers.Nullable) VERSION(com.microsoft.azure.hdinsight.sdk.rest.azure.datalake.analytics.job.models.ApiVersion.VERSION) HttpResponse(com.microsoft.azure.hdinsight.sdk.common.HttpResponse) StringEntity(org.apache.http.entity.StringEntity) StandardCharsets(java.nio.charset.StandardCharsets) List(java.util.List) DataLakeStoreAccountInformation(com.microsoft.azure.hdinsight.sdk.rest.azure.datalake.analytics.accounts.models.DataLakeStoreAccountInformation) HttpGet(org.apache.http.client.methods.HttpGet) com.microsoft.azure.hdinsight.sdk.rest.azure.serverless.spark.models(com.microsoft.azure.hdinsight.sdk.rest.azure.serverless.spark.models) NameValuePair(org.apache.http.NameValuePair) Collections(java.util.Collections) AzureHttpObservable(com.microsoft.azure.hdinsight.sdk.common.AzureHttpObservable) DataLakeAnalyticsAccount(com.microsoft.azure.hdinsight.sdk.rest.azure.datalake.analytics.accounts.models.DataLakeAnalyticsAccount) Nullable(com.microsoft.azuretools.azurecommons.helpers.Nullable)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableSortedSet (com.google.common.collect.ImmutableSortedSet)1 ILogger (com.microsoft.azure.hdinsight.common.logger.ILogger)1 ClusterContainer (com.microsoft.azure.hdinsight.sdk.cluster.ClusterContainer)1 IClusterDetail (com.microsoft.azure.hdinsight.sdk.cluster.IClusterDetail)1 AzureDataLakeHttpObservable (com.microsoft.azure.hdinsight.sdk.common.AzureDataLakeHttpObservable)1 AzureHttpObservable (com.microsoft.azure.hdinsight.sdk.common.AzureHttpObservable)1 HttpResponse (com.microsoft.azure.hdinsight.sdk.common.HttpResponse)1 ODataParam (com.microsoft.azure.hdinsight.sdk.common.ODataParam)1 DataLakeAnalyticsAccount (com.microsoft.azure.hdinsight.sdk.rest.azure.datalake.analytics.accounts.models.DataLakeAnalyticsAccount)1 DataLakeAnalyticsAccountBasic (com.microsoft.azure.hdinsight.sdk.rest.azure.datalake.analytics.accounts.models.DataLakeAnalyticsAccountBasic)1 DataLakeStoreAccountInformation (com.microsoft.azure.hdinsight.sdk.rest.azure.datalake.analytics.accounts.models.DataLakeStoreAccountInformation)1 VERSION (com.microsoft.azure.hdinsight.sdk.rest.azure.datalake.analytics.job.models.ApiVersion.VERSION)1 JobInfoListResult (com.microsoft.azure.hdinsight.sdk.rest.azure.datalake.analytics.job.models.JobInfoListResult)1 JobState (com.microsoft.azure.hdinsight.sdk.rest.azure.datalake.analytics.job.models.JobState)1 com.microsoft.azure.hdinsight.sdk.rest.azure.serverless.spark.models (com.microsoft.azure.hdinsight.sdk.rest.azure.serverless.spark.models)1 SparkSubmitStorageType (com.microsoft.azure.hdinsight.spark.common.SparkSubmitStorageType)1 SparkSubmitStorageTypeOptionsForCluster (com.microsoft.azure.hdinsight.spark.common.SparkSubmitStorageTypeOptionsForCluster)1 AuthMethodManager (com.microsoft.azuretools.authmanage.AuthMethodManager)1 SubscriptionDetail (com.microsoft.azuretools.authmanage.models.SubscriptionDetail)1