Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

feat: Add "transfer_manager" module for concurrent uploads and downloads, as a preview feature - #943

Merged
andrewsg merged 19 commits into
mainfrom
multithread
Dec 6, 2022
Merged

feat: Add "transfer_manager" module for concurrent uploads and downloads, as a preview feature#943
andrewsg merged 19 commits into
mainfrom
multithread

Conversation

@andrewsg

Copy link
Copy Markdown
Contributor

This PR adds a "transfer_manager" module which enables concurrent downloads and uploads of multiple files via the use of a thread pool. Transfer Manager is a preview feature and the API and behavior are subject to change before a GA launch of the feature in the future. A warning is emitted on import to this effect. Please do not hesitate to submit bugs and general feedback, positive or negative, by opening a github issue.

The performance of this feature is sensitive to the value of the "threads" parameter and the specifics of the environment and workload. Read the docstrings on "threads" and experiment to find what works best for each use case.

@andrewsg
andrewsg requested a review from a team as a code ownerDecember 6, 2022 19:44
@andrewsg
andrewsg requested review from a team and dandhleeDecember 6, 2022 19:44
@product-auto-labelproduct-auto-labelBot added size: xl Pull request size is extra large. api: storage Issues related to the googleapis/python-storage API. labels Dec 6, 2022
@andrewsgandrewsg changed the title feat: Add "transfer_manager" module preview featurefeat: Add "transfer_manager" module for concurrent uploads and downloads, as a preview featureDec 6, 2022

@frankynfrankyn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit; thanks for addressing the comments from yesterday's discussion.

# limitations under the License.


def upload_many_blobs_with_transfer_manager(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this PR / release can you split these samples into respective files?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment threadsamples/snippets/storage_transfer_manager.py Outdated
from google.api_core import exceptions


def test_upload_many(shared_bucket, file_data, blobs_to_delete):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a subsequent PR please add a file object of 16mib range so it tests resumable upload code path

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: storageIssues related to the googleapis/python-storage API.size: xlPull request size is extra large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@andrewsg@frankyn