kafka-connect-storage-cloud
kafka-connect-storage-cloud copied to clipboard
MINOR: Adds possibility to use custom FilenameCreator
Problem
When writing to S3 there is no possibility to decide on the actual filename that ends up in the bucket. Sometimes, we want to be able to do this to make it more clear on what the file contains and to have more control. I have described it in this: https://github.com/confluentinc/kafka-connect-storage-cloud/issues/631 issue
Solution
I have added an interface called FilenameCreator. This interface can be implemented on a custom class and added as config. If none is provided we fall back to TopicPartitionFilenameCreator that preserves the way that file names where created before this change. So no breaking changes.
Does this solution apply anywhere else?
- [x ] yes
- [ ] no
If yes, where?
TopicPartitionWriter now uses a fileName creator, but the change does not affect previous behaviour. S3SinkConnectorConfig now has a new key: s3.filename.creator.class for specifying your own FilenameCreator
Test Strategy
Changed existing tests to use new FilenameCreator
Testing done:
- [ x] Unit tests
- [ x] Integration tests
- [ ] System tests
- [x ] Manual tests
Release Plan
Merging to master
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.