about summary refs log tree commit diff
path: root/tvix/store/protos/rpc_blobstore_grpc.pb.go
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-02-03T21·53+0100
committerflokli <flokli@flokli.de>2023-02-07T14·14+0000
commit87e1934f2d08127cc064279a02b462eabbbdf3ee (patch)
tree94c5b2af9d549a22cbea24904e4119b2acc59591 /tvix/store/protos/rpc_blobstore_grpc.pb.go
parent0a27344953e9c5c46519758a8ef6dc2bbe2ed18a (diff)
docs(store/protos): update comment on blobstore Read and Put r/5840
Further emphasize Read() can be used to ask for blobs OR chunks, and
that clients usually want to stat and then request (smaller) chunks,
rather than reading whole blobs.

Also clarify that the chunking used to send BlobChunks over has nothing
to do with the chunk sizes communicated in a Stat() request.

Change-Id: Ia615d190aae570611de2655b11342a14d0b75976
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8028
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store/protos/rpc_blobstore_grpc.pb.go')
-rw-r--r--tvix/store/protos/rpc_blobstore_grpc.pb.go40
1 files changed, 36 insertions, 4 deletions
diff --git a/tvix/store/protos/rpc_blobstore_grpc.pb.go b/tvix/store/protos/rpc_blobstore_grpc.pb.go
index f952e78d5a6e..25b3c0006a51 100644
--- a/tvix/store/protos/rpc_blobstore_grpc.pb.go
+++ b/tvix/store/protos/rpc_blobstore_grpc.pb.go
@@ -29,10 +29,26 @@ type BlobServiceClient interface {
 	// If there's no more granular chunking available, the response will simply
 	// contain a single chunk.
 	Stat(ctx context.Context, in *StatBlobRequest, opts ...grpc.CallOption) (*BlobMeta, error)
-	// Read returns a stream of BlobChunk, which is just a stream of bytes - not necessarily
-	// using the chunking that's returned in the reply of a Stat() call.
+	// Read returns a stream of BlobChunk, which is just a stream of bytes with
+	// the digest specified in ReadBlobRequest.
+	//
+	// The server may decide on whatever chunking it may seem fit as a size for
+	// the individual BlobChunk sent in the response stream.
+	//
+	// It specifically is NOT necessarily using chunk sizes communicated in a
+	// previous Stat request.
+	//
+	// It's up to the specific store to decide on whether it allows Read on a
+	// Blob at all, or only on smaller chunks communicated in a Stat() call
+	// first.
+	//
+	// Clients are enouraged to Stat() first, and then only read the individual
+	// chunks they don't have yet.
 	Read(ctx context.Context, in *ReadBlobRequest, opts ...grpc.CallOption) (BlobService_ReadClient, error)
 	// Put uploads a Blob, by reading a stream of bytes.
+	//
+	// The way the data is chunked up in individual BlobChunk messages sent in
+	// the stream has no effect on how the server ends up chunking blobs up.
 	Put(ctx context.Context, opts ...grpc.CallOption) (BlobService_PutClient, error)
 }
 
@@ -130,10 +146,26 @@ type BlobServiceServer interface {
 	// If there's no more granular chunking available, the response will simply
 	// contain a single chunk.
 	Stat(context.Context, *StatBlobRequest) (*BlobMeta, error)
-	// Read returns a stream of BlobChunk, which is just a stream of bytes - not necessarily
-	// using the chunking that's returned in the reply of a Stat() call.
+	// Read returns a stream of BlobChunk, which is just a stream of bytes with
+	// the digest specified in ReadBlobRequest.
+	//
+	// The server may decide on whatever chunking it may seem fit as a size for
+	// the individual BlobChunk sent in the response stream.
+	//
+	// It specifically is NOT necessarily using chunk sizes communicated in a
+	// previous Stat request.
+	//
+	// It's up to the specific store to decide on whether it allows Read on a
+	// Blob at all, or only on smaller chunks communicated in a Stat() call
+	// first.
+	//
+	// Clients are enouraged to Stat() first, and then only read the individual
+	// chunks they don't have yet.
 	Read(*ReadBlobRequest, BlobService_ReadServer) error
 	// Put uploads a Blob, by reading a stream of bytes.
+	//
+	// The way the data is chunked up in individual BlobChunk messages sent in
+	// the stream has no effect on how the server ends up chunking blobs up.
 	Put(BlobService_PutServer) error
 	mustEmbedUnimplementedBlobServiceServer()
 }