use of com.microsoft.azuretools.azurecommons.helpers.Nullable 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());
}
use of com.microsoft.azuretools.azurecommons.helpers.Nullable in project azure-tools-for-java by Microsoft.
the class SparkBatchSubmission method getSSLSocketFactory.
@Nullable
protected SSLConnectionSocketFactory getSSLSocketFactory() {
TrustStrategy ts = ServiceManager.getServiceProvider(TrustStrategy.class);
SSLConnectionSocketFactory sslSocketFactory = null;
if (ts != null) {
try {
SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(ts).build();
sslSocketFactory = new SSLConnectionSocketFactory(sslContext, HttpObservable.isSSLCertificateValidationDisabled() ? NoopHostnameVerifier.INSTANCE : new DefaultHostnameVerifier());
} catch (NoSuchAlgorithmException | KeyManagementException | KeyStoreException e) {
log().error("Prepare SSL Context for HTTPS failure. " + ExceptionUtils.getStackTrace(e));
}
}
return sslSocketFactory;
}
Aggregations