Package org.opensearch.repositories.gcs
Class GoogleCloudStorageService
java.lang.Object
org.opensearch.repositories.gcs.GoogleCloudStorageService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.cloud.storage.Storageclient(String clientName, String repositoryName, org.opensearch.repositories.gcs.GoogleCloudStorageOperationsStats stats) Attempts to retrieve a client from the cache.voidrefreshAndClearCache(Map<String, GoogleCloudStorageClientSettings> clientsSettings) Refreshes the client settings and clears the client cache.
-
Constructor Details
-
GoogleCloudStorageService
public GoogleCloudStorageService()
-
-
Method Details
-
refreshAndClearCache
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(String clientName, String repositoryName, org.opensearch.repositories.gcs.GoogleCloudStorageOperationsStats stats) throws IOException Attempts 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:
IOException
-