Class AzureStorageService

java.lang.Object
org.opensearch.repositories.azure.AzureStorageService
All Implemented Interfaces:
AutoCloseable

public class AzureStorageService extends Object implements AutoCloseable
  • Field Details

    • MIN_CHUNK_SIZE

      public static final ByteSizeValue MIN_CHUNK_SIZE
      Maximum blob's block size size
    • MAX_CHUNK_SIZE

      public static final ByteSizeValue MAX_CHUNK_SIZE
      Maximum allowed blob's block size in Azure blob store.
  • Constructor Details

    • AzureStorageService

      public AzureStorageService(Settings settings)
  • Method Details

    • client

      public Tuple<com.azure.storage.blob.BlobServiceClient,Supplier<com.azure.core.util.Context>> client(String clientName)
      Obtains a BlobServiceClient on each invocation using the current client settings. BlobServiceClient is thread safe and and could be cached but the settings can change, therefore the instance might be recreated from scratch.
      Parameters:
      clientName - client name
      Returns:
      the BlobServiceClient instance and context
    • client

      public Tuple<com.azure.storage.blob.BlobServiceClient,Supplier<com.azure.core.util.Context>> client(String clientName, BiConsumer<com.azure.core.http.HttpRequest,com.azure.core.http.HttpResponse> statsCollector)
      Obtains a BlobServiceClient on each invocation using the current client settings. BlobServiceClient is thread safe and and could be cached but the settings can change, therefore the instance might be recreated from scratch.
      Parameters:
      clientName - client name
      statsCollector - statistics collector
      Returns:
      the BlobServiceClient instance and context
    • refreshAndClearCache

      public Map<String,org.opensearch.repositories.azure.AzureStorageSettings> refreshAndClearCache(Map<String,org.opensearch.repositories.azure.AzureStorageSettings> clientsSettings)
      Updates settings for building clients. Any client cache is cleared. Future client requests will use the new refreshed settings.
      Parameters:
      clientsSettings - the settings for new clients
      Returns:
      the old settings
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • getBlobRequestTimeout

      public Duration getBlobRequestTimeout(String clientName)