@@ -54,16 +54,16 @@ ApiFuture<ObjectReadSession> readSession(BidiReadObjectRequest req, GrpcCallCont
5454 "ranges included in the initial request are not supported" );
5555 ObjectReadSessionState state = new ObjectReadSessionState (ctx , req );
5656
57+ ZeroCopyBidiStreamingCallable <BidiReadObjectRequest , BidiReadObjectResponse > callable =
58+ getCallable ();
5759 ObjectReadSessionStream stream =
58- ObjectReadSessionStream .create (
59- executor , bidiReadObject , state , retryContextProvider .create ());
60+ ObjectReadSessionStream .create (executor , callable , state , retryContextProvider .create ());
6061
6162 ApiFuture <ObjectReadSession > objectReadSessionFuture =
6263 ApiFutures .transform (
6364 stream ,
6465 nowOpen ->
65- new ObjectReadSessionImpl (
66- executor , bidiReadObject , stream , state , retryContextProvider ),
66+ new ObjectReadSessionImpl (executor , callable , stream , state , retryContextProvider ),
6767 executor );
6868 stream .send (req );
6969 return objectReadSessionFuture ;
@@ -79,9 +79,10 @@ <Projection> ApiFuture<FastOpenObjectReadSession<Projection>> fastOpenReadSessio
7979 "ranges included in the initial request are not supported" );
8080 ObjectReadSessionState state = new ObjectReadSessionState (ctx , openRequest );
8181
82+ ZeroCopyBidiStreamingCallable <BidiReadObjectRequest , BidiReadObjectResponse > callable =
83+ getCallable ();
8284 ObjectReadSessionStream stream =
83- ObjectReadSessionStream .create (
84- executor , bidiReadObject , state , retryContextProvider .create ());
85+ ObjectReadSessionStream .create (executor , callable , state , retryContextProvider .create ());
8586
8687 long readId = state .newReadId ();
8788 ObjectReadSessionStreamRead <Projection > read =
@@ -94,7 +95,7 @@ <Projection> ApiFuture<FastOpenObjectReadSession<Projection>> fastOpenReadSessio
9495 nowOpen ->
9596 new FastOpenObjectReadSession <>(
9697 new ObjectReadSessionImpl (
97- executor , bidiReadObject , stream , state , retryContextProvider ),
98+ executor , callable , stream , state , retryContextProvider ),
9899 read ,
99100 stream ),
100101 executor );
@@ -113,6 +114,11 @@ public void close() throws IOException {
113114 }
114115 }
115116
117+ private ZeroCopyBidiStreamingCallable <BidiReadObjectRequest , BidiReadObjectResponse >
118+ getCallable () {
119+ return bidiReadObject .withDefaultCallContext (Retrying .newCallContext ());
120+ }
121+
116122 static StorageDataClient create (
117123 ScheduledExecutorService executor ,
118124 ZeroCopyBidiStreamingCallable <BidiReadObjectRequest , BidiReadObjectResponse > read ,
0 commit comments