Skip to content

feat(storage): readSession can send first reads in the open request - #14789

Draft
Dhriti07 wants to merge 1 commit into
mainfrom
fast-open/01-first-reads-in-open
Draft

Dhriti07 wants to merge 1 commit into
mainfrom
fast-open/01-first-reads-in-open

Conversation

@Dhriti07

Copy link
Copy Markdown
Contributor

1/n PR for Fast Open Bidi Reads Implementation in Java SDK.

StorageDataClient.readSession(req, ctx, firstReadConfigs) creates a read for each config and registers it in the session state before the stream is opened.
The open request is now built from the session state which adds the range of every registered read, so the first reads are part of the open request and the bytes the server returns with the open are delivered to them. The existing two-argument method opens with no first reads and sends exactly the same request as before.

The session does not hand these reads out yet

@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 support for sending initial read ranges during the opening of an ObjectReadSession in StorageDataClient. It overloads the readSession method to accept a list of initial read projection configurations, registers them into the session state, and sends the open request populated with these ranges. Additionally, a new integration test class, ITFastOpenFakeTest, has been added to verify that the open request correctly includes or excludes these initial reads. No review comments were provided, so there is no additional feedback to address.

First step of fast open BiDi reads (go/fast-open-bidi-read, b/552263062).
Today a read takes two round trips: one to open the session, one to send the
first range.

StorageDataClient.readSession(req, ctx, fastOpenConfigs) creates a read for
each config and registers it in the session state before the stream is
opened. The open request is now built from the session state
(ObjectReadSessionState.getOpenArguments(), already used when the stream
restarts), which adds the range of every registered read, so the fast open
reads are part of the open request and the bytes the server returns with the
open are delivered to them. The existing two-argument method opens with no
fast open reads and sends exactly the same request as before.

The session does not hand these reads out yet; that is the next change, which
also replaces the single-range prototype fastOpenReadSession.
@Dhriti07
Dhriti07 force-pushed the fast-open/01-first-reads-in-open branch from 92aa755 to 19a09bd Compare October 27, 2026 20:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant