Skip to content

feat(storage): add multistream options to MRD#13758

Merged
krishnamd-jkp merged 2 commits into
googleapis:mainfrom
krishnamd-jkp:multistream_impl
Feb 20, 2026
Merged

feat(storage): add multistream options to MRD#13758
krishnamd-jkp merged 2 commits into
googleapis:mainfrom
krishnamd-jkp:multistream_impl

Conversation

@krishnamd-jkp

Copy link
Copy Markdown
Contributor

No description provided.

@krishnamd-jkp krishnamd-jkp requested review from a team February 3, 2026 07:24
@krishnamd-jkp krishnamd-jkp requested a review from a team as a code owner February 3, 2026 07:24
@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Feb 3, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @krishnamd-jkp, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the MultiRangeDownloader by integrating new multistream configuration capabilities. It provides users with fine-grained control over the number of concurrent connections and the conditions under which new connections are initiated, aiming to optimize performance and resource management for multi-range object downloads. The changes include adding new parameters to the downloader's internal structure, implementing a mechanism for applying default values, and exposing these settings through a user-friendly option pattern.

Highlights

  • Multistream Configuration: Introduced new configuration options for the MultiRangeDownloader (MRD) to control multistream behavior, including minimum and maximum connections, and thresholds for triggering new connections based on pending ranges or bytes.
  • Flexible Option Pattern: Implemented an MRDOption interface and associated With... functions, allowing users to configure these new multistream settings in a flexible and extensible manner when creating a MultiRangeDownloader.
  • Default Settings: Added default values for the new multistream parameters, ensuring sensible behavior even when specific options are not explicitly provided by the user.
Changelog
  • storage/client.go
    • Added minConnections, maxConnections, targetPendingRanges, and targetPendingBytes fields to the newMultiRangeDownloaderParams struct to store multistream settings.
  • storage/grpc_reader_multi_range.go
    • Implemented a defaults() method for newMultiRangeDownloaderParams to set initial values for the new multistream configuration fields if they are not explicitly provided.
    • Called the params.defaults() method during the initialization of a new MultiRangeDownloader to ensure default settings are applied.
  • storage/reader.go
    • Defined the MRDOption interface and concrete types (minConnections, maxConnections, targetPendingRanges, targetPendingBytes) to encapsulate individual multistream configuration options.
    • Introduced public functions (WithMinConnections, WithMaxConnections, WithTargetPendingRanges, WithTargetPendingBytes) that return MRDOption instances, enabling external configuration.
    • Modified the ObjectHandle.NewMultiRangeDownloader method to accept variadic MRDOption arguments, allowing users to pass multiple configuration options.
    • Added logic within ObjectHandle.NewMultiRangeDownloader to iterate through and apply the provided MRDOptions to the newMultiRangeDownloaderParams.
Activity
  • No specific activity (comments, reviews, etc.) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces multistream options for the MultiRangeDownloader, allowing for more granular control over connection management and pending range/byte thresholds. The changes include adding new fields to the newMultiRangeDownloaderParams struct, implementing a defaults() method to set initial values, and providing an idiomatic Go options pattern (MRDOption interface and With... functions) for configuring these settings. The overall approach is sound and improves the flexibility of the MultiRangeDownloader. The review comments highlight areas for improved readability and clarity in the code and its documentation.

Comment thread storage/grpc_reader_multi_range.go Outdated
Comment thread storage/reader.go Outdated
@krishnamd-jkp

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces new options for the Multi-Range Downloader (MRD) to configure its multistreaming behavior, such as connection counts and pending data thresholds. The changes are well-structured, using the functional options pattern to provide a clean API for these new settings. My review includes a few minor suggestions to improve comment clarity and fix typos in the documentation for these new options.

Comment thread storage/grpc_reader_multi_range.go Outdated
Comment thread storage/reader.go Outdated
Comment thread storage/reader.go Outdated

@tritone tritone 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.

Options pattern looks good to me

Comment thread storage/reader.go

@cpriti-os cpriti-os 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.

Looks good.

@krishnamd-jkp krishnamd-jkp merged commit 4557675 into googleapis:main Feb 20, 2026
10 checks passed
krishnamd-jkp added a commit that referenced this pull request Mar 10, 2026
PR created by the Librarian CLI to initialize a release. Merging this PR
will auto trigger a release.

Librarian Version: v0.8.3
Language Image:
us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/librarian-go@sha256:19bb93e8f1f916c61b597db2bad65dc432f79baaabb210499d7d0e4ad1dffe29
<details><summary>storage: v1.61.0</summary>

##
[v1.61.0](storage/v1.60.0...storage/v1.61.0)
(2026-03-10)

### Features

* add bucket encryption enforcement configuration (#13874)
([245c8d7](245c8d76))

* add multistream options to MRD (#13758)
([4557675](4557675e))

* add a DeleteFolderRecursive API definition (PiperOrigin-RevId:
866471251)
([6f31019](6f310199))

* add multistream support to MRD (#13792)
([ffa7268](ffa7268c))

### Bug Fixes

* Fix TM download dir corner case (#14142)
([87cdcc9](87cdcc9f))

* Omit auto checksum in final request when MD5 is given (#14024)
([d404777](d4047774))

* optimize gRPC writer with zero-copy and lazy allocation (#13481)
([df64147](df641476))

</details>
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