Package com.github.ambry.named
Interface NamedBlobDb
-
public interface NamedBlobDb
A layer for interacting with a metadata store that holds mappings between blob names and blob IDs.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<DeleteResult>
delete(java.lang.String accountName, java.lang.String containerName, java.lang.String blobName)
Delete a record for a blob in the database.java.util.concurrent.CompletableFuture<NamedBlobRecord>
get(java.lang.String accountName, java.lang.String containerName, java.lang.String blobName)
Look up aNamedBlobRecord
by name.java.util.concurrent.CompletableFuture<Page<NamedBlobRecord>>
list(java.lang.String accountName, java.lang.String containerName, java.lang.String blobNamePrefix, java.lang.String continuationToken)
List blobs that start with a provided prefix in a container.java.util.concurrent.CompletableFuture<PutResult>
put(NamedBlobRecord record)
Persist aNamedBlobRecord
in the database.
-
-
-
Method Detail
-
get
java.util.concurrent.CompletableFuture<NamedBlobRecord> get(java.lang.String accountName, java.lang.String containerName, java.lang.String blobName)
Look up aNamedBlobRecord
by name.- Parameters:
accountName
- the name of the account.containerName
- the name of the container.blobName
- the name of the blob.- Returns:
- a
CompletableFuture
that will eventually contain either theNamedBlobRecord
for the named blob or an exception if an error occurred.
-
list
java.util.concurrent.CompletableFuture<Page<NamedBlobRecord>> list(java.lang.String accountName, java.lang.String containerName, java.lang.String blobNamePrefix, java.lang.String continuationToken)
List blobs that start with a provided prefix in a container. This returns paginated results. If there are additional pages to read,Page.getContinuationToken()
will be non null.- Parameters:
accountName
- the name of the account.containerName
- the name of the container.blobNamePrefix
- the name prefix to search for.continuationToken
- ifnull
, return the first page ofNamedBlobRecord
s that start withblobNamePrefix
. If set, use this as a token to resume reading additional pages of records that start with the prefix.- Returns:
- a
CompletableFuture
that will eventually contain aPage
ofNamedBlobRecord
s starting with the specified prefix or an exception if an error occurred.
-
put
java.util.concurrent.CompletableFuture<PutResult> put(NamedBlobRecord record)
Persist aNamedBlobRecord
in the database.- Parameters:
record
- theNamedBlobRecord
- Returns:
- a
CompletableFuture
that will eventually contain aPutResult
or an exception if an error occurred.
-
delete
java.util.concurrent.CompletableFuture<DeleteResult> delete(java.lang.String accountName, java.lang.String containerName, java.lang.String blobName)
Delete a record for a blob in the database.- Parameters:
accountName
- the name of the account.containerName
- the name of the container.blobName
- the name of the blob.- Returns:
- a
CompletableFuture
that will eventually contain aDeleteResult
or an exception if an error occurred.
-
-