Class GoogleCloudStorageService


  • public class GoogleCloudStorageService
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.google.cloud.storage.Storage client​(java.lang.String clientName, java.lang.String repositoryName, org.opensearch.repositories.gcs.GoogleCloudStorageOperationsStats stats)
      Attempts to retrieve a client from the cache.
      void refreshAndClearCache​(java.util.Map<java.lang.String,​GoogleCloudStorageClientSettings> clientsSettings)
      Refreshes the client settings and clears the client cache.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GoogleCloudStorageService

        public GoogleCloudStorageService()
    • 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 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​(java.lang.String clientName,
                                                       java.lang.String repositoryName,
                                                       org.opensearch.repositories.gcs.GoogleCloudStorageOperationsStats stats)
                                                throws java.io.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:
        java.io.IOException