Skip to content
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

KAFKA-10720: Document prohibition on header mutation by SMTs #9597

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -33,6 +33,11 @@ public interface Transformation<R extends ConnectRecord<R>> extends Configurable
* Apply transformation to the {@code record} and return another record object (which may be {@code record} itself) or {@code null},
* corresponding to a map or filter operation respectively.
*
* A transformation must not mutate objects reachable from the given {@code record}
* (including, but not limited to, {@link org.apache.kafka.connect.header.Headers},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change {@link org.apache.kafka.connect.header.Headers} to {@link org.apache.kafka.connect.header.Headers Headers} ?

* {@link org.apache.kafka.connect.data.Struct Structs}, {@code Lists}, and {@code Maps}).
* If such objects need to be changed, a new ConnectRecord should be created and returned.
*
* The implementation must be thread-safe.
*/
R apply(R record);
Expand Down