Repository navigation
Conversation
There was a problem hiding this comment.
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.
92aa755 to
19a09bd
Compare
nidhiii-27
left a comment
There was a problem hiding this comment.
Mostly looks good to me, just added a comment to update the new method's parameter type and some minor nits.
| ApiFuture<ObjectReadSession> readSession( | ||
| BidiReadObjectRequest req, | ||
| GrpcCallContext ctx, | ||
| List<ReadProjectionConfig<?>> fastOpenConfigs) { |
There was a problem hiding this comment.
In PR#14882 GrpcStorageImpl.blobReadSession is forced to create a new immutable list to satisfy this signature. We can avoid this by using a bounded wildcard List<? extends ReadProjectionConfig<?>> here instead.
|
|
||
| ObjectReadSession session = | ||
| dataClient.readSession(OPEN, CTX, ImmutableList.of(READ_10_TO_20)).get(5, SECONDS); | ||
| session.close(); |
There was a problem hiding this comment.
nit: Instead of manually closing the session, it might be worth using a try-with-resources block here and in other test methods.
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