FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

chore: refactorings for CreateMultipartUpload by BenWhitehead · Pull Request #3364 · googleapis/java-storage · GitHub

chore: refactorings for CreateMultipartUpload - #3364

Closed
BenWhitehead wants to merge 17 commits into
staged-mpu-merge-trainfrom
mpu-feature-2-ben-modifications
Closed

chore: refactorings for CreateMultipartUpload#3364
BenWhitehead wants to merge 17 commits into
staged-mpu-merge-trainfrom
mpu-feature-2-ben-modifications

Conversation

Copy link
Copy Markdown
Collaborator
  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.

ShreyasSinha and others added 17 commits October 20, 2025 08:00
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.
product-auto-label Bot added size: m Pull request size is medium. api: storage Issues related to the googleapis/java-storage API. labels Oct 23, 2025
BenWhitehead mentioned this pull request Oct 30, 2025
10 tasks
Base automatically changed from mpu-feature-2 to staged-mpu-merge-train November 3, 2025 21:11

Copy link
Copy Markdown
Collaborator Author

merged as part of #3356

BenWhitehead added a commit that referenced this pull request Nov 3, 2025
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 deleted the mpu-feature-2-ben-modifications branch November 3, 2025 23:02
BenWhitehead added a commit that referenced this pull request Nov 3, 2025
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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the googleapis/java-storage API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL