Class GoogleCloudStorageService

java.lang.Object
org.opensearch.repositories.gcs.GoogleCloudStorageService

public class GoogleCloudStorageService extends Object
  • Constructor Details

    • GoogleCloudStorageService

      public GoogleCloudStorageService()
  • Method Details

    • refreshAndClearCache

      public void refreshAndClearCache(Map<String,GoogleCloudStorageClientSettings> clientsSettings)
      Refreshes the client settings and clears the client cache. Subsequent calls to GoogleCloudStorageService#client will 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 client
      repositoryName - name of the repository that would use the client
      stats - 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