chore: refactorings for CreateMultipartUpload by BenWhitehead · Pull Request #3364 · googleapis/java-storage (original) (raw)

and others added 17 commits

October 20, 2025 08:00

@ShreyasSinha

@ShreyasSinha

@ShreyasSinha

@ShreyasSinha

@ShreyasSinha

@ShreyasSinha

@ShreyasSinha

@ShreyasSinha

@ShreyasSinha

@ShreyasSinha

@ShreyasSinha

@ShreyasSinha

@ShreyasSinha

@ShreyasSinha

@ShreyasSinha

@ShreyasSinha

@BenWhitehead

  1. Define Codec<OffsetDateTime, String> to encapsulate the logic and use of date time formatter
    • Use existing RFC3339 formatter as it's already used by json and tested to be valid
    • update tests to assert equality of OffsetDateTime instances instead of strings -- this ensures that equivalent times but different strings are valid
  2. Refactor the boostrapping of MultipartUploadHttpRequestManager to be a factory method that only needs HttpStorageOptions
    • This removes the need for tests and implementation to perform manual bootstrapping multiple times unnecessarily
    • It also removes the boostrapping logic from MultipartUploadClientImpl and in turn removes the need for HttpStorageOptions to be passed around to multiple places
  3. pre-compute and have a single stable location for all headers which apply to all requests -- x-goog-api-client, x-goog-user-project, user-agent, etc
    • This makes it so fewer things need to know about and interact with HttpStorageOptions, thereby simplifying multiple methods
    • The logic and resolution happens once per client instance removing the need for redundant string concatenations, or environment probes
    • leverages existing abstractions for representing headers, and plumbs user provided headers from HttpStorageOptions
  4. Add logic to compute x-goog-api-client header to match what apiary does
  5. Update request header processing to avoid allocating a temporary map, instead add directly to the requests headers.

Base automatically changed from mpu-feature-2 to staged-mpu-merge-train

November 3, 2025 21:11

BenWhitehead added a commit that referenced this pull request

Nov 3, 2025

@ShreyasSinha @BenWhitehead

BEGIN_NESTED_COMMIT

BEGIN_COMMIT_OVERRIDE feat: add preview MultipartUploadClient#createMultipartUpload #3356 END_COMMIT_OVERRIDE

BEGIN_COMMIT_OVERRIDE feat: add preview MultipartUploadClient#listParts #3359 END_COMMIT_OVERRIDE

BEGIN_COMMIT_OVERRIDE feat: add preview MultipartUploadClient#abortMultipartUpload #3361 END_COMMIT_OVERRIDE

BEGIN_COMMIT_OVERRIDE feat: add preview MultipartUploadClient#uploadPart #3375 END_COMMIT_OVERRIDE

BEGIN_COMMIT_OVERRIDE feat: add preview MultipartUploadClient#completeMultipartUpload #3372 END_COMMIT_OVERRIDE

BEGIN_COMMIT_OVERRIDE feat: add preview MultipartUploadSettings END_COMMIT_OVERRIDE

BEGIN_COMMIT_OVERRIDE END_COMMIT_OVERRIDE

END_NESTED_COMMIT

Other changes:

  1. chore: refactor retrier creation from HttpStorageOptions to StorageOptions #3350
  2. chore: refactorings for CreateMultipartUpload #3364
  3. chore: fix xml parsing of StringEnumValue's so that the enum contract is not broken #3377
  4. chore: add PredefinedAcl#xmlEntry

Co-authored-by: BenWhitehead BenWhitehead@users.noreply.github.com

BenWhitehead added a commit that referenced this pull request

Nov 3, 2025

@ShreyasSinha @BenWhitehead

BEGIN_NESTED_COMMIT

BEGIN_COMMIT_OVERRIDE feat: add preview MultipartUploadClient#createMultipartUpload #3356 END_COMMIT_OVERRIDE

BEGIN_COMMIT_OVERRIDE feat: add preview MultipartUploadClient#listParts #3359 END_COMMIT_OVERRIDE

BEGIN_COMMIT_OVERRIDE feat: add preview MultipartUploadClient#abortMultipartUpload #3361 END_COMMIT_OVERRIDE

BEGIN_COMMIT_OVERRIDE feat: add preview MultipartUploadClient#uploadPart #3375 END_COMMIT_OVERRIDE

BEGIN_COMMIT_OVERRIDE feat: add preview MultipartUploadClient#completeMultipartUpload #3372 END_COMMIT_OVERRIDE

BEGIN_COMMIT_OVERRIDE feat: add preview MultipartUploadSettings END_COMMIT_OVERRIDE

BEGIN_COMMIT_OVERRIDE END_COMMIT_OVERRIDE

END_NESTED_COMMIT

Other changes:

  1. chore: refactor retrier creation from HttpStorageOptions to StorageOptions #3350
  2. chore: refactorings for CreateMultipartUpload #3364
  3. chore: fix xml parsing of StringEnumValue's so that the enum contract is not broken #3377
  4. chore: add PredefinedAcl#xmlEntry

Co-authored-by: BenWhitehead BenWhitehead@users.noreply.github.com

BenWhitehead added a commit that referenced this pull request

Nov 3, 2025

@ShreyasSinha @BenWhitehead

BEGIN_NESTED_COMMIT

BEGIN_COMMIT_OVERRIDE feat: add preview MultipartUploadClient#createMultipartUpload #3356 END_COMMIT_OVERRIDE

BEGIN_COMMIT_OVERRIDE feat: add preview MultipartUploadClient#listParts #3359 END_COMMIT_OVERRIDE

BEGIN_COMMIT_OVERRIDE feat: add preview MultipartUploadClient#abortMultipartUpload #3361 END_COMMIT_OVERRIDE

BEGIN_COMMIT_OVERRIDE feat: add preview MultipartUploadClient#uploadPart #3375 END_COMMIT_OVERRIDE

BEGIN_COMMIT_OVERRIDE feat: add preview MultipartUploadClient#completeMultipartUpload #3372 END_COMMIT_OVERRIDE

BEGIN_COMMIT_OVERRIDE feat: add preview MultipartUploadSettings END_COMMIT_OVERRIDE

BEGIN_COMMIT_OVERRIDE END_COMMIT_OVERRIDE

END_NESTED_COMMIT

Other changes:

  1. chore: refactor retrier creation from HttpStorageOptions to StorageOptions #3350
  2. chore: refactorings for CreateMultipartUpload #3364
  3. chore: fix xml parsing of StringEnumValue's so that the enum contract is not broken #3377
  4. chore: add PredefinedAcl#xmlEntry

Co-authored-by: BenWhitehead BenWhitehead@users.noreply.github.com

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})