Package org.opensearch.repositories.gcs
Class GoogleCloudStorageService
- java.lang.Object
-
- org.opensearch.repositories.gcs.GoogleCloudStorageService
-
public class GoogleCloudStorageService extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description GoogleCloudStorageService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.cloud.storage.Storageclient(java.lang.String clientName, java.lang.String repositoryName, org.opensearch.repositories.gcs.GoogleCloudStorageOperationsStats stats)Attempts to retrieve a client from the cache.voidrefreshAndClearCache(java.util.Map<java.lang.String,GoogleCloudStorageClientSettings> clientsSettings)Refreshes the client settings and clears the client cache.
-
-
-
Method Detail
-
refreshAndClearCache
public void refreshAndClearCache(java.util.Map<java.lang.String,GoogleCloudStorageClientSettings> clientsSettings)
Refreshes the client settings and clears the client cache. Subsequent calls toGoogleCloudStorageService#clientwill return new clients constructed using the parameter settings.- Parameters:
clientsSettings- the new settings used for building clients for subsequent requests
-
client
public com.google.cloud.storage.Storage client(java.lang.String clientName, java.lang.String repositoryName, org.opensearch.repositories.gcs.GoogleCloudStorageOperationsStats stats) throws java.io.IOExceptionAttempts to retrieve a client from the cache. If the client does not exist it will be created from the latest settings and will populate the cache. The returned instance should not be cached by the calling code. Instead, for each use, the (possibly updated) instance should be requested by calling this method.- Parameters:
clientName- name of the client settings used to create the clientrepositoryName- name of the repository that would use the clientstats- the stats collector used to gather information about the underlying SKD API calls.- Returns:
- a cached client storage instance that can be used to manage objects (blobs)
- Throws:
java.io.IOException
-
-