Class AzureStorageService

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

public class AzureStorageService extends Object implements AutoCloseable
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.opensearch.core.common.unit.ByteSizeValue
    Maximum allowed blob's block size in Azure blob store.
    static final org.opensearch.core.common.unit.ByteSizeValue
    Maximum blob's block size size
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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.
    void
     
     
    Map<String,org.opensearch.repositories.azure.AzureStorageSettings>
    refreshAndClearCache(Map<String,org.opensearch.repositories.azure.AzureStorageSettings> clientsSettings)
    Updates settings for building clients.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MIN_CHUNK_SIZE

      public static final org.opensearch.core.common.unit.ByteSizeValue MIN_CHUNK_SIZE
      Maximum blob's block size size
    • MAX_CHUNK_SIZE

      public static final org.opensearch.core.common.unit.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)