feat(gax): retry start upload call and rename ResumableUploadCallSettings to ResumableUploadOptions - #14509
feat(gax): retry start upload call and rename ResumableUploadCallSettings to ResumableUploadOptions#14509blakeli0 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the resumable upload configuration by replacing ResumableUploadCallSettings with ResumableUploadOptions for invocation-level options, and utilizing standard UnaryCallSettings for method-level settings. This change simplifies the settings hierarchy and affects client generation, stub settings, and the HTTP/JSON transport layer. The review feedback suggests enhancing type safety in HttpJsonResumableUploadClient and ResumableUploadStartCallable by replacing wildcard generic types with specific type parameters matching the request and response types.
| public static <RequestT, ResponseT> HttpJsonResumableUploadClient<RequestT, ResponseT> create( | ||
| ClientContext clientContext, | ||
| ApiMethodDescriptor<RequestT, ResponseT> methodDescriptor, | ||
| UnaryCallSettings<?, ?> callSettings) { |
There was a problem hiding this comment.
Using UnaryCallSettings<RequestT, ResponseT> instead of the wildcard UnaryCallSettings<?, ?> improves type safety by ensuring that the call settings match the request and response types of the client.
| UnaryCallSettings<?, ?> callSettings) { | |
| UnaryCallSettings<RequestT, ResponseT> callSettings) { |
| ClientContext clientContext, ApiMethodDescriptor<RequestT, ResponseT> methodDescriptor) { | ||
| ClientContext clientContext, | ||
| ApiMethodDescriptor<RequestT, ResponseT> methodDescriptor, | ||
| UnaryCallSettings<?, ?> callSettings) { |
There was a problem hiding this comment.
Using UnaryCallSettings<RequestT, ResponseT> instead of the wildcard UnaryCallSettings<?, ?> improves type safety by ensuring that the call settings match the request and response types of the client.
| UnaryCallSettings<?, ?> callSettings) { | |
| UnaryCallSettings<RequestT, ResponseT> callSettings) { |
| static <RequestT> UnaryCallable<RequestT, ResumableUploadSession> create( | ||
| ClientContext clientContext, | ||
| ApiMethodDescriptor<RequestT, String> descriptor, | ||
| UnaryCallSettings<?, ?> callSettings) { |
There was a problem hiding this comment.
12c430b to
45aa2e8
Compare
…ings to ResumableUploadOptions
45aa2e8 to
ef2660a
Compare
Summary
ResumableUploadCallSettingstoResumableUploadOptions: Decouples per-RPC invocation options (chunkSizeandglobalTimeout) from method-levelCallSettingssoResumableUploadOptionsis strictly passed per-call toResumableUploadCallable.futureCall(...)/resumeCall(...)and convenience upload methods.UnaryCallSettingsinCallables.resumableUpload,HttpJsonCallableFactory.createResumableUploadCallable,HttpJsonResumableUploadClient.create, andResumableUploadStartCallable.create: UsesUnaryCallSettings<RequestT, ?>inHttpJsonResumableUploadClientandResumableUploadStartCallable(without extra overloads) and configures retryable codes and retry settings for the initialstartupload HTTP call (X-Goog-Upload-Command: start).ResumableUploadStartCallable: Wraps the rawResumableUploadStartCallableinHttpJsonExceptionCallable(withcallSettings.getRetryableCodes()) andCallables.retrying(callable, callSettings, clientContext)so transient failures during session initiation are retried automatically.globalTimeoutfromUnaryCallSettings:Callables.resumableUploadderives the defaultResumableUploadOptionsglobalTimeoutfromcallSettings.getRetrySettings().getTotalTimeoutDuration().Related PRs