Skip to content

Commit

Permalink
[common] Add version signature to the blob manager interface (#1022)
Browse files Browse the repository at this point in the history
add version to the blob manager interface
  • Loading branch information
adamxchen authored Jun 10, 2024
1 parent 4c52343 commit 8e78b81
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,26 @@ public interface BlobTransferManager<T> extends AutoCloseable {

/**
* Get the blobs for the given storeName and partition
*
* @param storeName
* @param version
* @param partition
* @return the InputStream of the blob. The return type is experimental and may change in the future.
* @throws VeniceNoStoreException
*/
@Experimental
CompletionStage<? extends InputStream> get(String storeName, int partition) throws VeniceNoStoreException;
CompletionStage<? extends InputStream> get(String storeName, int version, int partition)
throws VeniceNoStoreException;

/**
* Put the blob for the given storeName and partition
*
* @param storeName
* @param version
* @param partition
* @return the type of the object returned from the underlying blob client to indicate the upload status
*/
CompletionStage<T> put(String storeName, int partition);
CompletionStage<T> put(String storeName, int version, int partition);

/**
* Close the blob transfer manager and related resources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
*/
public interface P2PBlobTransferManager<T> extends BlobTransferManager<T> {
/**
* For P2P blob transfer, only GET should be implemented and there's no need to implement PUT method by default.
* It's subject to change depending on the use cases to use P2P blob transfer.
* For P2P blob transfer, only GET should be implemented and there's no need to implement PUT method by default. It's
* subject to change depending on the use cases to use P2P blob transfer.
*
* @param storeName
* @param version
* @param partition
* @return the type of the object returned from the underlying blob client to indicate the upload status
*/
default CompletionStage<T> put(String storeName, int partition) {
default CompletionStage<T> put(String storeName, int version, int partition) {
throw new VeniceException("PUT method is not supported for P2P Blob Transfer");
}
}

0 comments on commit 8e78b81

Please sign in to comment.