Repository navigation
Provide a way to stream read/write requests using a single RPC call #72
Description
Activity
- changed the title
[-]Should we provide a way to stream read/write requests using a single RPC call.[/-][+]Should we provide a way to stream read/write requests using a single RPC call?[/+]on May 27, 2015 - addedtype: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.and removedtype: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
on May 27, 2015 PR #534 was taking a stub at it for BigQuery. It would be great if we resurrect it when possible and also apply it for Storage.
I started having a look at this lately. My only concern is how to expose this functionality to users. Now in
Storagewe have:Blob create(BlobInfo blobInfo, byte[] content, BlobTargetOption... options); Blob create(BlobInfo blobInfo, InputStream content, BlobWriteOption... options);
Both method use non-resumable upload.
As far as I know when resumable upload is used to create a object the RPC call does not return the object metadata in the response body. So methods that use resumable upload would not be able to offer a return type. Should we call such methods
writerather thancreate?Also, resumable upload as implemented in #534 needs a
SeekableByteChannelto function (in case of failed upload we need to seek latest upload position through the channel) and not anInputStream. Would adding the following two methods look odd to you?void write(BlobInfo blobInfo, byte[] content, BlobTargetOption... options); void write(BlobInfo blobInfo, SeekableByteChannel content, BlobWriteOption... options);
/cc @jgeewax for opinions
@Capstan Is there a way to make resumable upload return the information on the blob just created (as it happens for direct upload)? Just to be sure I am not missing something here.
If not, would it be possible in your opinion to have the "closing" call to a resumable upload URL return the blob's information in the response body?
@mziccard I would be surprised to find that it does not return that information. What's the behavior you're seeing? What are you using for your
altparameter?I am requesting a resumable upload URL with:
POST https://www.googleapis.com/upload/storage/v1/b/test-bucket/o?uploadType=resumable&name=test-file (blob information in the body)Which returns the resumable URL in the body:
https://www.googleapis.com/upload/storage/v1/b/test-bucket/o?uploadType=resumable&name=test-blob&upload_id=some-long-upload-idI upload the file with:
POST https://www.googleapis.com/upload/storage/v1/b/test-bucket/o?uploadType=resumable&name=test-blob&upload_id=some-long-upload-idThe blob is correctly created, upload is successful but this latest request does not return blob information back.
@Capstan any update on this?
None, though I'm used to seeing PUT in the last request. See https://cloud.google.com/storage/docs/json_api/v1/how-tos/resumable-upload for examples.
17 remaining items
- added a commit that references this issue
on Dec 22, 2025 - added a commit that references this issue
on Jan 22, 2026 - added a commit that references this issue
on Feb 24, 2026 - added a commit that references this issue
on Mar 11, 2026 - added a commit that references this issue
on Mar 12, 2026 - added a commit that references this issue
on Mar 30, 2026 - added a commit that references this issue
on Apr 1, 2026 - added a commit that references this issue
on Jul 13, 2026
This topic was also discussed in #61. Current implementation of the streaming API for both reads and writes is done via multiple RPC calls. Writes are done in chucks (resumable-writes) which is good for error handling (save-points) but at a cost of multiple RPC instead of one. Reads are also segmented (via range requests) instead one RPC for the whole content.
Things to consider: