Class AzureStorageService
- java.lang.Object
-
- org.opensearch.repositories.azure.AzureStorageService
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class AzureStorageService extends java.lang.Object implements java.lang.AutoCloseable
-
-
Field Summary
Fields Modifier and Type Field Description static ByteSizeValueMAX_CHUNK_SIZEMaximum allowed blob's block size in Azure blob store.static ByteSizeValueMIN_CHUNK_SIZEMaximum blob's block size size
-
Constructor Summary
Constructors Constructor Description AzureStorageService(Settings settings)
-
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 aBlobServiceClienton 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 aBlobServiceClienton each invocation using the current client settings.voidclose()java.time.DurationgetBlobRequestTimeout(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.
-
-
-
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 aBlobServiceClienton 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
BlobServiceClientinstance 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 aBlobServiceClienton 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 namestatsCollector- statistics collector- Returns:
- the
BlobServiceClientinstance 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:
closein interfacejava.lang.AutoCloseable
-
getBlobRequestTimeout
public java.time.Duration getBlobRequestTimeout(java.lang.String clientName)
-
-