From 8e78b811c61bfab557b4546821b8323486485e44 Mon Sep 17 00:00:00 2001 From: "Xin(Adam) Chen" Date: Mon, 10 Jun 2024 09:10:45 -0700 Subject: [PATCH] [common] Add version signature to the blob manager interface (#1022) add version to the blob manager interface --- .../venice/blobtransfer/BlobTransferManager.java | 9 +++++++-- .../venice/blobtransfer/P2PBlobTransferManager.java | 8 +++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/internal/venice-common/src/main/java/com/linkedin/venice/blobtransfer/BlobTransferManager.java b/internal/venice-common/src/main/java/com/linkedin/venice/blobtransfer/BlobTransferManager.java index 09c12dbcf8f..ae7a93ab851 100644 --- a/internal/venice-common/src/main/java/com/linkedin/venice/blobtransfer/BlobTransferManager.java +++ b/internal/venice-common/src/main/java/com/linkedin/venice/blobtransfer/BlobTransferManager.java @@ -22,21 +22,26 @@ public interface BlobTransferManager 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 get(String storeName, int partition) throws VeniceNoStoreException; + CompletionStage 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 put(String storeName, int partition); + CompletionStage put(String storeName, int version, int partition); /** * Close the blob transfer manager and related resources diff --git a/internal/venice-common/src/main/java/com/linkedin/venice/blobtransfer/P2PBlobTransferManager.java b/internal/venice-common/src/main/java/com/linkedin/venice/blobtransfer/P2PBlobTransferManager.java index 9a55447f1d7..edf75cd033d 100644 --- a/internal/venice-common/src/main/java/com/linkedin/venice/blobtransfer/P2PBlobTransferManager.java +++ b/internal/venice-common/src/main/java/com/linkedin/venice/blobtransfer/P2PBlobTransferManager.java @@ -10,13 +10,15 @@ */ public interface P2PBlobTransferManager extends BlobTransferManager { /** - * 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 put(String storeName, int partition) { + default CompletionStage put(String storeName, int version, int partition) { throw new VeniceException("PUT method is not supported for P2P Blob Transfer"); } }