Skip to content

fix(storage): modify the callback of mrd to return length of data read instead of limit.#11687

Merged
gcf-merge-on-green[bot] merged 7 commits intogoogleapis:mainfrom
shubham-diwakar:modify-callback
Mar 6, 2025
Merged

fix(storage): modify the callback of mrd to return length of data read instead of limit.#11687
gcf-merge-on-green[bot] merged 7 commits intogoogleapis:mainfrom
shubham-diwakar:modify-callback

Conversation

@shubham-diwakar
Copy link
Copy Markdown
Contributor

@shubham-diwakar shubham-diwakar commented Mar 5, 2025

Currently MRD takes a callback in each Add call.
Current call back returns the offset, length and error on that add call making the callback function look like, func(int64,int64,error) .
In some scenario data read can be different from limit set.
For example: We just have 50 bytes to read and ask for 100 bytes(length/limit) in this scenario we will return just 50 bytes.

Hence changed the callback to return amount of data read instead of data limit set.

Added the go doc for callback.

@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Mar 5, 2025
@shubham-diwakar shubham-diwakar marked this pull request as ready for review March 5, 2025 10:49
@shubham-diwakar shubham-diwakar requested a review from a team March 5, 2025 10:49
@danielduhh danielduhh requested a review from BrennaEpp March 5, 2025 19:37
Comment thread storage/integration_test.go Outdated
@tritone tritone requested a review from a team March 6, 2025 21:55
@tritone tritone added the automerge Merge the pull request once unit tests and other checks pass. label Mar 6, 2025
@gcf-merge-on-green gcf-merge-on-green Bot merged commit 9e359f0 into googleapis:main Mar 6, 2025
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants