Class AzureStorageService

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class AzureStorageService
    extends java.lang.Object
    implements java.lang.AutoCloseable
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Tuple<com.azure.storage.blob.BlobServiceClient,​java.util.function.Supplier<com.azure.core.util.Context>> client​(java.lang.String clientName)
      Obtains a BlobServiceClient on each invocation using the current client settings.
      Tuple<com.azure.storage.blob.BlobServiceClient,​java.util.function.Supplier<com.azure.core.util.Context>> client​(java.lang.String clientName, java.util.function.BiConsumer<com.azure.core.http.HttpRequest,​com.azure.core.http.HttpResponse> statsCollector)
      Obtains a BlobServiceClient on each invocation using the current client settings.
      void close()  
      java.time.Duration getBlobRequestTimeout​(java.lang.String clientName)  
      java.util.Map<java.lang.String,​org.opensearch.repositories.azure.AzureStorageSettings> refreshAndClearCache​(java.util.Map<java.lang.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 Detail

      • 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 Detail

      • AzureStorageService

        public AzureStorageService​(Settings settings)
    • Method Detail

      • client

        public Tuple<com.azure.storage.blob.BlobServiceClient,​java.util.function.Supplier<com.azure.core.util.Context>> client​(java.lang.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,​java.util.function.Supplier<com.azure.core.util.Context>> client​(java.lang.String clientName,
                                                                                                                                     java.util.function.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 java.util.Map<java.lang.String,​org.opensearch.repositories.azure.AzureStorageSettings> refreshAndClearCache​(java.util.Map<java.lang.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 java.lang.AutoCloseable
      • getBlobRequestTimeout

        public java.time.Duration getBlobRequestTimeout​(java.lang.String clientName)