Skip to content

feat(storage): add flag for enable and disable multi stream feature.#15893

Merged
v-pratap merged 5 commits intogoogleapis:mainfrom
v-pratap:add-disable-flag
Jan 22, 2026
Merged

feat(storage): add flag for enable and disable multi stream feature.#15893
v-pratap merged 5 commits intogoogleapis:mainfrom
v-pratap:add-disable-flag

Conversation

@v-pratap
Copy link
Contributor

No description provided.

@v-pratap v-pratap requested review from a team as code owners January 21, 2026 08:27
@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Jan 21, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @v-pratap, 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 Google Cloud Storage client by introducing a new configuration option, EnableMultiStreamOptimizationOption, which allows users to enable or disable multi-stream downloads for objects. This optimization is designed to improve performance for large object transfers. The changes involve defining this new boolean option, setting its default to enabled, and integrating it into the ObjectDescriptorImpl to control the creation and management of background streams. Comprehensive unit tests have been added and updated to validate the functionality and ensure correct behavior when the option is both enabled and disabled.

Highlights

  • New Configuration Option: Introduced EnableMultiStreamOptimizationOption to control multi-stream object downloads, allowing users to explicitly enable or disable this performance feature.
  • Default Behavior: The EnableMultiStreamOptimizationOption is set to true by default in the asynchronous client options, activating the optimization out-of-the-box.
  • Conditional Stream Management: Modified ObjectDescriptorImpl to conditionally enable background stream creation and subsequent stream management based on the new EnableMultiStreamOptimizationOption.
  • New Test Case: Added a new test case, MultiStreamOptimizationDisabled, to confirm that disabling multi-stream optimization correctly prevents additional stream creation.
  • Test Updates: Updated numerous existing ObjectDescriptorImpl test cases to explicitly pass the Options object, ensuring consistent behavior with the new flag.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

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 a feature flag EnableMultiStreamOptimizationOption to control the multi-stream download feature, which is a great addition for configurability. The implementation correctly guards the multi-stream logic based on this option, and it's enabled by default for optimal performance out-of-the-box. The tests have been updated to account for this new option, and a new test case validates the behavior when the feature is disabled.

My main feedback relates to the test file google/cloud/storage/internal/async/object_descriptor_impl_test.cc, where the necessary updates have introduced significant boilerplate code across numerous tests. I've suggested a small refactoring to encapsulate this common setup, which should improve the readability and maintainability of the test suite.

@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

❌ Patch coverage is 97.61905% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.96%. Comparing base (3959c49) to head (765f595).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...d/storage/internal/async/object_descriptor_impl.cc 77.77% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15893   +/-   ##
=======================================
  Coverage   92.95%   92.96%           
=======================================
  Files        2460     2460           
  Lines      228641   228679   +38     
=======================================
+ Hits       212544   212583   +39     
+ Misses      16097    16096    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@v-pratap v-pratap changed the title feat(storage): add flag for enable and disable to multi stream feature. feat(storage): add flag for enable and disable multi stream feature. Jan 21, 2026
@v-pratap v-pratap merged commit 0f4b6db into googleapis:main Jan 22, 2026
57 of 58 checks passed
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.

2 participants