-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Kafka Connect: Add Configurable Committer Support #14672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Kafka Connect: Add Configurable Committer Support #14672
Conversation
|
@bryanck for review. |
| import org.apache.kafka.connect.sink.SinkRecord; | ||
| import org.apache.kafka.connect.sink.SinkTaskContext; | ||
|
|
||
| public interface Committer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might look like backward incompatible change but as this config option to plug committer is not there it is very highly likely that users are using the CommitterImpl by default and this is the right time to change these API's and make this sensible and in sync with the Connect Task terminologies. Also this helps us prevent the current hacks and edge cases like using isInitialized to check multiple times and at multiple places to avoid having null pointer exception.
Summary
This PR adds support for pluggable Committer implementations in the Iceberg Kafka Connect connector, allowing users to provide custom commit strategies via configuration. Previously, the connector was hardcoded to use CommitterImpl. This change enables users to implement and configure custom committers without modifying the connector source code.
Motivation
Different use cases may require different commit strategies:
The current implementation hardcodes CommitterImpl, requiring users to fork the codebase to implement custom commit logic. This PR makes the committer pluggable while maintaining full backward
compatibility.
Backward Compatibility
This change is fully backward compatible:
Usage Example
Uses default CommitterImpl
Default Behavior (No Configuration Changes):
iceberg.tables=my_db.my_table
iceberg.catalog.type=hadoop
iceberg.catalog.warehouse=s3://my-bucket/warehouse
Loads custom committer
Custom Committer:
iceberg.tables=my_db.my_table
iceberg.catalog.type=hadoop
iceberg.catalog.warehouse=s3://my-bucket/warehouse
iceberg.committer.class=com.example.MyCustomCommitter
Testing
Test coverage includes:
Files Changed
Modified:
Added:
Removed: