feat: add support for setting S3 storage class on initial object write#1241
Open
mattsre wants to merge 3 commits intostreamnative:masterfrom
Open
feat: add support for setting S3 storage class on initial object write#1241mattsre wants to merge 3 commits intostreamnative:masterfrom
mattsre wants to merge 3 commits intostreamnative:masterfrom
Conversation
|
Thanks for this improvement! I see that you have added unit tests for the configuration validation, which is great, but would it be possible to add some integration tests to this, e.g. using the TestContainers framework, etc? FWIW, I have attached an AI-generated integration test that you can use as a template for the test. |
Author
|
@david-streamlio I've added some integration tests here for verifying the storage class behavior. I haven't written much Java so there was a fair bit of AI help getting these together. Let me know if any changes are required or there's any test cases you'd like to see added! |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The connector currently only writes to the STANDARD S3 storage class. If we want to reduce costs by using archival storage classes like Glacier, we must setup a lifecycle policy to transition objects on some schedule to our desired storage class. Transitioning objects has an associated cost, and we pay extra to keep objects in the STANDARD storage class until they can be transitioned to our desired storage class.
I'd like to reduce costs and simplify operations by having the Pulsar S3 connector simply write the object to the desired storage class when the object is initially written.
Modifications
I've added an
s3StorageClassparameter to the Sink config which allows setting the storage class which will be used when making the PutObject API call to S3.Verifying this change
This change added tests and can be verified as follows:
s3StorageClassparameterDocumentation
docI've updated documentation to include the new
s3StorageClassparameter