use of com.microsoft.azure.storage.RetryPolicyFactory in project kylo by Teradata.
the class AzureNativeFileSystemProvider method createBlobClient.
@Nonnull
private CloudBlobClient createBlobClient(@Nonnull final URI uri, @Nonnull final Configuration conf) {
// Determine endpoint
final String httpScheme = StringUtils.equalsAnyIgnoreCase(uri.getScheme(), "asvs", "wasbs") ? "https" : "http";
final URI blobEndPoint = URI.create(httpScheme + "://" + uri.getRawAuthority());
// Create client
final CloudBlobClient client = new CloudBlobClient(blobEndPoint, getCredentials(uri, conf));
final RetryPolicyFactory retryPolicyFactory = new RetryExponentialRetry(conf.getInt("fs.azure.io.retry.min.backoff.interval", 3 * 1000), conf.getInt("fs.azure.io.retry.backoff.interval", 3 * 1000), conf.getInt("fs.azure.io.retry.max.backoff.interval", 30 * 1000), conf.getInt("fs.azure.io.retry.max.retries", 30));
client.getDefaultRequestOptions().setRetryPolicyFactory(retryPolicyFactory);
final int storageConnectionTimeout = conf.getInt("fs.azure.storage.timeout", 0);
if (storageConnectionTimeout > 0) {
client.getDefaultRequestOptions().setTimeoutIntervalInMs(storageConnectionTimeout * 1000);
}
return client;
}
Aggregations