Class BlobStoreProviderProxy

  • All Implemented Interfaces:
    com.bazaarvoice.emodb.blob.api.BlobStore

    public class BlobStoreProviderProxy
    extends java.lang.Object
    implements com.bazaarvoice.emodb.blob.api.BlobStore
    Supports delegation of DDL operations to the system data center. This implementation uses a Providers for the blob store injection to prevent re-entrant injection issues.
    • Constructor Summary

      Constructors 
      Constructor Description
      BlobStoreProviderProxy​(com.google.inject.Provider<com.bazaarvoice.emodb.blob.api.BlobStore> local, com.google.inject.Provider<com.bazaarvoice.emodb.blob.api.BlobStore> system)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void createTable​(java.lang.String table, com.bazaarvoice.emodb.sor.api.TableOptions options, java.util.Map<java.lang.String,​java.lang.String> attributes, com.bazaarvoice.emodb.sor.api.Audit audit)  
      void delete​(java.lang.String table, java.lang.String blobId)  
      void dropTable​(java.lang.String table, com.bazaarvoice.emodb.sor.api.Audit audit)  
      com.bazaarvoice.emodb.blob.api.Blob get​(java.lang.String table, java.lang.String blobId)  
      com.bazaarvoice.emodb.blob.api.Blob get​(java.lang.String table, java.lang.String blobId, com.bazaarvoice.emodb.blob.api.RangeSpecification rangeSpec)  
      com.bazaarvoice.emodb.blob.api.BlobMetadata getMetadata​(java.lang.String table, java.lang.String blobId)  
      long getTableApproximateSize​(java.lang.String table)  
      java.util.Map<java.lang.String,​java.lang.String> getTableAttributes​(java.lang.String table)  
      boolean getTableExists​(java.lang.String table)  
      com.bazaarvoice.emodb.blob.api.Table getTableMetadata​(java.lang.String table)  
      com.bazaarvoice.emodb.sor.api.TableOptions getTableOptions​(java.lang.String table)  
      java.util.Collection<java.lang.String> getTablePlacements()  
      boolean isTableAvailable​(java.lang.String table)  
      java.util.Iterator<com.bazaarvoice.emodb.blob.api.Table> listTables​(java.lang.String fromTableExclusive, long limit)  
      void purgeTableUnsafe​(java.lang.String table, com.bazaarvoice.emodb.sor.api.Audit audit)  
      void put​(java.lang.String table, java.lang.String blobId, java.util.function.Supplier<? extends java.io.InputStream> in, java.util.Map<java.lang.String,​java.lang.String> attributes)  
      java.util.Iterator<com.bazaarvoice.emodb.blob.api.BlobMetadata> scanMetadata​(java.lang.String table, java.lang.String fromBlobIdExclusive, long limit)  
      void setTableAttributes​(java.lang.String table, java.util.Map<java.lang.String,​java.lang.String> attributes, com.bazaarvoice.emodb.sor.api.Audit audit)  
      • Methods inherited from class java.lang.Object

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

      • BlobStoreProviderProxy

        @Inject
        public BlobStoreProviderProxy​(com.google.inject.Provider<com.bazaarvoice.emodb.blob.api.BlobStore> local,
                                      com.google.inject.Provider<com.bazaarvoice.emodb.blob.api.BlobStore> system)
    • Method Detail

      • createTable

        public void createTable​(java.lang.String table,
                                com.bazaarvoice.emodb.sor.api.TableOptions options,
                                java.util.Map<java.lang.String,​java.lang.String> attributes,
                                com.bazaarvoice.emodb.sor.api.Audit audit)
                         throws com.bazaarvoice.emodb.sor.api.TableExistsException
        Specified by:
        createTable in interface com.bazaarvoice.emodb.blob.api.BlobStore
        Throws:
        com.bazaarvoice.emodb.sor.api.TableExistsException
      • dropTable

        public void dropTable​(java.lang.String table,
                              com.bazaarvoice.emodb.sor.api.Audit audit)
                       throws com.bazaarvoice.emodb.sor.api.UnknownTableException
        Specified by:
        dropTable in interface com.bazaarvoice.emodb.blob.api.BlobStore
        Throws:
        com.bazaarvoice.emodb.sor.api.UnknownTableException
      • setTableAttributes

        public void setTableAttributes​(java.lang.String table,
                                       java.util.Map<java.lang.String,​java.lang.String> attributes,
                                       com.bazaarvoice.emodb.sor.api.Audit audit)
                                throws com.bazaarvoice.emodb.sor.api.UnknownTableException
        Specified by:
        setTableAttributes in interface com.bazaarvoice.emodb.blob.api.BlobStore
        Throws:
        com.bazaarvoice.emodb.sor.api.UnknownTableException
      • listTables

        public java.util.Iterator<com.bazaarvoice.emodb.blob.api.Table> listTables​(@Nullable
                                                                                   java.lang.String fromTableExclusive,
                                                                                   long limit)
        Specified by:
        listTables in interface com.bazaarvoice.emodb.blob.api.BlobStore
      • purgeTableUnsafe

        public void purgeTableUnsafe​(java.lang.String table,
                                     com.bazaarvoice.emodb.sor.api.Audit audit)
                              throws com.bazaarvoice.emodb.sor.api.UnknownTableException
        Specified by:
        purgeTableUnsafe in interface com.bazaarvoice.emodb.blob.api.BlobStore
        Throws:
        com.bazaarvoice.emodb.sor.api.UnknownTableException
      • getTableExists

        public boolean getTableExists​(java.lang.String table)
        Specified by:
        getTableExists in interface com.bazaarvoice.emodb.blob.api.BlobStore
      • isTableAvailable

        public boolean isTableAvailable​(java.lang.String table)
        Specified by:
        isTableAvailable in interface com.bazaarvoice.emodb.blob.api.BlobStore
      • getTableMetadata

        public com.bazaarvoice.emodb.blob.api.Table getTableMetadata​(java.lang.String table)
        Specified by:
        getTableMetadata in interface com.bazaarvoice.emodb.blob.api.BlobStore
      • getTableAttributes

        public java.util.Map<java.lang.String,​java.lang.String> getTableAttributes​(java.lang.String table)
                                                                                  throws com.bazaarvoice.emodb.sor.api.UnknownTableException
        Specified by:
        getTableAttributes in interface com.bazaarvoice.emodb.blob.api.BlobStore
        Throws:
        com.bazaarvoice.emodb.sor.api.UnknownTableException
      • getTableOptions

        public com.bazaarvoice.emodb.sor.api.TableOptions getTableOptions​(java.lang.String table)
                                                                   throws com.bazaarvoice.emodb.sor.api.UnknownTableException
        Specified by:
        getTableOptions in interface com.bazaarvoice.emodb.blob.api.BlobStore
        Throws:
        com.bazaarvoice.emodb.sor.api.UnknownTableException
      • getTableApproximateSize

        public long getTableApproximateSize​(java.lang.String table)
                                     throws com.bazaarvoice.emodb.sor.api.UnknownTableException
        Specified by:
        getTableApproximateSize in interface com.bazaarvoice.emodb.blob.api.BlobStore
        Throws:
        com.bazaarvoice.emodb.sor.api.UnknownTableException
      • getMetadata

        public com.bazaarvoice.emodb.blob.api.BlobMetadata getMetadata​(java.lang.String table,
                                                                       java.lang.String blobId)
                                                                throws com.bazaarvoice.emodb.blob.api.BlobNotFoundException
        Specified by:
        getMetadata in interface com.bazaarvoice.emodb.blob.api.BlobStore
        Throws:
        com.bazaarvoice.emodb.blob.api.BlobNotFoundException
      • scanMetadata

        public java.util.Iterator<com.bazaarvoice.emodb.blob.api.BlobMetadata> scanMetadata​(java.lang.String table,
                                                                                            @Nullable
                                                                                            java.lang.String fromBlobIdExclusive,
                                                                                            long limit)
        Specified by:
        scanMetadata in interface com.bazaarvoice.emodb.blob.api.BlobStore
      • get

        public com.bazaarvoice.emodb.blob.api.Blob get​(java.lang.String table,
                                                       java.lang.String blobId)
                                                throws com.bazaarvoice.emodb.blob.api.BlobNotFoundException
        Specified by:
        get in interface com.bazaarvoice.emodb.blob.api.BlobStore
        Throws:
        com.bazaarvoice.emodb.blob.api.BlobNotFoundException
      • get

        public com.bazaarvoice.emodb.blob.api.Blob get​(java.lang.String table,
                                                       java.lang.String blobId,
                                                       @Nullable
                                                       com.bazaarvoice.emodb.blob.api.RangeSpecification rangeSpec)
                                                throws com.bazaarvoice.emodb.blob.api.BlobNotFoundException,
                                                       com.bazaarvoice.emodb.blob.api.RangeNotSatisfiableException
        Specified by:
        get in interface com.bazaarvoice.emodb.blob.api.BlobStore
        Throws:
        com.bazaarvoice.emodb.blob.api.BlobNotFoundException
        com.bazaarvoice.emodb.blob.api.RangeNotSatisfiableException
      • put

        public void put​(java.lang.String table,
                        java.lang.String blobId,
                        java.util.function.Supplier<? extends java.io.InputStream> in,
                        java.util.Map<java.lang.String,​java.lang.String> attributes)
                 throws java.io.IOException
        Specified by:
        put in interface com.bazaarvoice.emodb.blob.api.BlobStore
        Throws:
        java.io.IOException
      • delete

        public void delete​(java.lang.String table,
                           java.lang.String blobId)
        Specified by:
        delete in interface com.bazaarvoice.emodb.blob.api.BlobStore
      • getTablePlacements

        public java.util.Collection<java.lang.String> getTablePlacements()
        Specified by:
        getTablePlacements in interface com.bazaarvoice.emodb.blob.api.BlobStore