Package com.bazaarvoice.emodb.blob.core
Class DefaultBlobStore
- java.lang.Object
-
- com.bazaarvoice.emodb.blob.core.DefaultBlobStore
-
- All Implemented Interfaces:
com.bazaarvoice.emodb.blob.api.BlobStore
public class DefaultBlobStore extends java.lang.Object implements com.bazaarvoice.emodb.blob.api.BlobStoreStores large binary objects like photos, videos.
-
-
Constructor Summary
Constructors Constructor Description DefaultBlobStore(com.bazaarvoice.emodb.table.db.TableDAO tableDao, StorageProvider storageProvider, MetadataProvider metadataProvider, com.codahale.metrics.MetricRegistry metricRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateTable(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)voiddelete(java.lang.String tableName, java.lang.String blobId)voiddropTable(java.lang.String table, com.bazaarvoice.emodb.sor.api.Audit audit)com.bazaarvoice.emodb.blob.api.Blobget(java.lang.String table, java.lang.String blobId)com.bazaarvoice.emodb.blob.api.Blobget(java.lang.String tableName, java.lang.String blobId, com.bazaarvoice.emodb.blob.api.RangeSpecification rangeSpec)com.bazaarvoice.emodb.blob.api.BlobMetadatagetMetadata(java.lang.String tableName, java.lang.String blobId)longgetTableApproximateSize(java.lang.String tableName)java.util.Map<java.lang.String,java.lang.String>getTableAttributes(java.lang.String table)booleangetTableExists(java.lang.String table)com.bazaarvoice.emodb.blob.api.TablegetTableMetadata(java.lang.String table)com.bazaarvoice.emodb.sor.api.TableOptionsgetTableOptions(java.lang.String table)java.util.Collection<java.lang.String>getTablePlacements()booleanisTableAvailable(java.lang.String table)java.util.Iterator<com.bazaarvoice.emodb.blob.api.Table>listTables(java.lang.String fromTableExclusive, long limit)voidpurgeTableUnsafe(java.lang.String tableName, com.bazaarvoice.emodb.sor.api.Audit audit)voidput(java.lang.String tableName, 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 tableName, java.lang.String fromBlobIdExclusive, long limit)voidsetTableAttributes(java.lang.String table, java.util.Map<java.lang.String,java.lang.String> attributes, com.bazaarvoice.emodb.sor.api.Audit audit)
-
-
-
Constructor Detail
-
DefaultBlobStore
@Inject public DefaultBlobStore(com.bazaarvoice.emodb.table.db.TableDAO tableDao, StorageProvider storageProvider, MetadataProvider metadataProvider, com.codahale.metrics.MetricRegistry metricRegistry)
-
-
Method Detail
-
listTables
public java.util.Iterator<com.bazaarvoice.emodb.blob.api.Table> listTables(@Nullable java.lang.String fromTableExclusive, long limit)- Specified by:
listTablesin interfacecom.bazaarvoice.emodb.blob.api.BlobStore
-
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:
createTablein interfacecom.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:
dropTablein interfacecom.bazaarvoice.emodb.blob.api.BlobStore- Throws:
com.bazaarvoice.emodb.sor.api.UnknownTableException
-
purgeTableUnsafe
public void purgeTableUnsafe(java.lang.String tableName, com.bazaarvoice.emodb.sor.api.Audit audit) throws com.bazaarvoice.emodb.sor.api.UnknownTableException- Specified by:
purgeTableUnsafein interfacecom.bazaarvoice.emodb.blob.api.BlobStore- Throws:
com.bazaarvoice.emodb.sor.api.UnknownTableException
-
getTableExists
public boolean getTableExists(java.lang.String table)
- Specified by:
getTableExistsin interfacecom.bazaarvoice.emodb.blob.api.BlobStore
-
isTableAvailable
public boolean isTableAvailable(java.lang.String table)
- Specified by:
isTableAvailablein interfacecom.bazaarvoice.emodb.blob.api.BlobStore
-
getTableMetadata
public com.bazaarvoice.emodb.blob.api.Table getTableMetadata(java.lang.String table)
- Specified by:
getTableMetadatain interfacecom.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:
getTableAttributesin interfacecom.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:
setTableAttributesin interfacecom.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:
getTableOptionsin interfacecom.bazaarvoice.emodb.blob.api.BlobStore- Throws:
com.bazaarvoice.emodb.sor.api.UnknownTableException
-
getTableApproximateSize
public long getTableApproximateSize(java.lang.String tableName) throws com.bazaarvoice.emodb.sor.api.UnknownTableException- Specified by:
getTableApproximateSizein interfacecom.bazaarvoice.emodb.blob.api.BlobStore- Throws:
com.bazaarvoice.emodb.sor.api.UnknownTableException
-
getMetadata
public com.bazaarvoice.emodb.blob.api.BlobMetadata getMetadata(java.lang.String tableName, java.lang.String blobId) throws com.bazaarvoice.emodb.blob.api.BlobNotFoundException- Specified by:
getMetadatain interfacecom.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 tableName, @Nullable java.lang.String fromBlobIdExclusive, long limit)- Specified by:
scanMetadatain interfacecom.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:
getin interfacecom.bazaarvoice.emodb.blob.api.BlobStore- Throws:
com.bazaarvoice.emodb.blob.api.BlobNotFoundException
-
get
public com.bazaarvoice.emodb.blob.api.Blob get(java.lang.String tableName, java.lang.String blobId, @Nullable com.bazaarvoice.emodb.blob.api.RangeSpecification rangeSpec) throws com.bazaarvoice.emodb.blob.api.BlobNotFoundException- Specified by:
getin interfacecom.bazaarvoice.emodb.blob.api.BlobStore- Throws:
com.bazaarvoice.emodb.blob.api.BlobNotFoundException
-
put
public void put(java.lang.String tableName, 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:
putin interfacecom.bazaarvoice.emodb.blob.api.BlobStore- Throws:
java.io.IOException
-
delete
public void delete(java.lang.String tableName, java.lang.String blobId)- Specified by:
deletein interfacecom.bazaarvoice.emodb.blob.api.BlobStore
-
getTablePlacements
public java.util.Collection<java.lang.String> getTablePlacements()
- Specified by:
getTablePlacementsin interfacecom.bazaarvoice.emodb.blob.api.BlobStore
-
-