Repository navigation
blob/gcsblob: parallel downloads via driver.DownloaderAt - #3807
Merged
Merged
Conversation
Collaborator
|
Please sync now that #3805 is merged. |
Implement DownloadAt using cloud.google.com/go/storage/transfermanager, a subpackage of the storage module this driver already depends on. It reuses the driver's existing *storage.Client and writes concurrent ranged reads directly into the io.WriterAt destination. With this, blob.Bucket.Download into an io.WriterAt (e.g. an *os.File) fetches GCS objects in parallel instead of on a single stream. Part of google#3804
stanhu
force-pushed
the
sh-gcsblob-parallel-download
branch
from
November 1, 2026 06:39
a6af3e5 to
67e3ee2
Compare
stanhu
marked this pull request as ready for review
November 1, 2026 06:41
Collaborator
|
I verified that this works using the drivertest in #3815. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3807 +/- ##
==========================================
- Coverage 80.46% 80.28% -0.19%
==========================================
Files 104 104
Lines 12377 12405 +28
==========================================
Hits 9959 9959
- Misses 2417 2445 +28
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #3805, now merged, which added
driver.DownloaderAtand theBucket.Downloadrouting. Rebased onto master, so this PR contains only its own change.What
Implements
driver.DownloaderAtin gcsblob, soBucket.Downloadinto anio.WriterAt(e.g. an*os.File) fetches GCS objects with concurrent ranged reads instead of a single stream.How
Uses
cloud.google.com/go/storage/transfermanager, a subpackage of thecloud.google.com/go/storagemodule gcsblob already depends on, so this adds an import but no new module. It reuses the driver's existing*storage.Clientviatransfermanager.NewDownloader, queues oneDownloadObjectwriting to the destinationio.WriterAt, and returns the first error fromWaitAndClose.BeforeReadexposes*transfermanager.DownloadObjectInput/*transfermanager.Downloader.Part size and concurrency use the transfer manager defaults; a follow-up can thread tunables through once #3806 (the
ReaderOptionsknobs) lands.Testing
go vet,gofmtclean. Compile-timevar _ driver.DownloaderAt = (*bucket)(nil)assertion added.Bucket.Download->DownloadAt) is unit-tested in blob: add optional parallel download via io.WriterAt #3805 with a fake driver.