Package com.github.ambry.cloud.azure
Class ConnectionStringBasedStorageClient
- java.lang.Object
-
- com.github.ambry.cloud.azure.StorageClient
-
- com.github.ambry.cloud.azure.ConnectionStringBasedStorageClient
-
public class ConnectionStringBasedStorageClient extends StorageClient
StorageClient
implementation based on connection string authentication.
-
-
Field Summary
-
Fields inherited from class com.github.ambry.cloud.azure.StorageClient
azureMetrics
-
-
Constructor Summary
Constructors Constructor Description ConnectionStringBasedStorageClient(com.azure.storage.blob.BlobServiceClient blobServiceClient, com.azure.storage.blob.batch.BlobBatchClient blobBatchClient, AzureMetrics azureMetrics, AzureBlobLayoutStrategy blobLayoutStrategy)
Constructor forConnectionStringBasedStorageClient
object for testing.ConnectionStringBasedStorageClient(com.github.ambry.config.CloudConfig cloudConfig, AzureCloudConfig azureCloudConfig, AzureMetrics azureMetrics, AzureBlobLayoutStrategy blobLayoutStrategy)
Constructor forConnectionStringBasedStorageClient
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.azure.storage.blob.BlobServiceClient
buildBlobServiceClient(com.azure.core.http.HttpClient httpClient, com.azure.core.util.Configuration configuration, com.azure.storage.common.policy.RequestRetryOptions retryOptions, AzureCloudConfig azureCloudConfig)
BuildBlobServiceClient
.protected boolean
handleExceptionAndHintRetry(com.azure.storage.blob.models.BlobStorageException blobStorageException)
Check if the exception can be handled and return a flag indicating if it can be retried.protected void
validateABSAuthConfigs(AzureCloudConfig azureCloudConfig)
Validate that all the required configs for connection string based authentication are present.-
Methods inherited from class com.github.ambry.cloud.azure.StorageClient
createBlobStorageClient, deleteBatch, downloadWithResponse, getPropertiesWithResponse, getStorageClient, setClientReferences, setMetadataWithResponse, uploadWithResponse, uploadWithResponse
-
-
-
-
Constructor Detail
-
ConnectionStringBasedStorageClient
public ConnectionStringBasedStorageClient(com.github.ambry.config.CloudConfig cloudConfig, AzureCloudConfig azureCloudConfig, AzureMetrics azureMetrics, AzureBlobLayoutStrategy blobLayoutStrategy)
Constructor forConnectionStringBasedStorageClient
.- Parameters:
cloudConfig
-CloudConfig
object.azureCloudConfig
-AzureCloudConfig
object.azureMetrics
-AzureMetrics
object.blobLayoutStrategy
-AzureBlobLayoutStrategy
object.
-
ConnectionStringBasedStorageClient
public ConnectionStringBasedStorageClient(com.azure.storage.blob.BlobServiceClient blobServiceClient, com.azure.storage.blob.batch.BlobBatchClient blobBatchClient, AzureMetrics azureMetrics, AzureBlobLayoutStrategy blobLayoutStrategy)
Constructor forConnectionStringBasedStorageClient
object for testing.- Parameters:
blobServiceClient
-BlobServiceClient
object.blobBatchClient
-BlobBatchClient
object.azureMetrics
-AzureMetrics
object.blobLayoutStrategy
-AzureBlobLayoutStrategy
object.
-
-
Method Detail
-
buildBlobServiceClient
protected com.azure.storage.blob.BlobServiceClient buildBlobServiceClient(com.azure.core.http.HttpClient httpClient, com.azure.core.util.Configuration configuration, com.azure.storage.common.policy.RequestRetryOptions retryOptions, AzureCloudConfig azureCloudConfig)
Description copied from class:StorageClient
BuildBlobServiceClient
.- Specified by:
buildBlobServiceClient
in classStorageClient
- Parameters:
httpClient
-HttpClient
object.configuration
-Configuration
object.retryOptions
-RetryOptions
object.azureCloudConfig
-AzureCloudConfig
object.- Returns:
BlobServiceClient
object.
-
validateABSAuthConfigs
protected void validateABSAuthConfigs(AzureCloudConfig azureCloudConfig)
Validate that all the required configs for connection string based authentication are present.- Specified by:
validateABSAuthConfigs
in classStorageClient
- Parameters:
azureCloudConfig
-AzureCloudConfig
object.
-
handleExceptionAndHintRetry
protected boolean handleExceptionAndHintRetry(com.azure.storage.blob.models.BlobStorageException blobStorageException)
Description copied from class:StorageClient
Check if the exception can be handled and return a flag indicating if it can be retried. Note that if this method changes state of this class, then it should do it in a thread safe way.- Specified by:
handleExceptionAndHintRetry
in classStorageClient
- Parameters:
blobStorageException
-BlobStorageException
object.- Returns:
- true if the operation can be retried. false otherwise.
-
-