You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/11/16 09:35:19 UTC

[GitHub] [kafka] tombentley opened a new pull request #9597: KAFKA-10720: Document prohibition on header mutation by SMTs

tombentley opened a new pull request #9597:
URL: https://github.com/apache/kafka/pull/9597


   Adds a sentence to the Javadoc for `Transformation` about not mutating headers.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] mimaison commented on a change in pull request #9597: KAFKA-10720: Document prohibition on header mutation by SMTs

Posted by GitBox <gi...@apache.org>.
mimaison commented on a change in pull request #9597:
URL: https://github.com/apache/kafka/pull/9597#discussion_r531168400



##########
File path: connect/api/src/main/java/org/apache/kafka/connect/transforms/Transformation.java
##########
@@ -33,6 +33,11 @@
      * 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},

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




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] tombentley commented on pull request #9597: KAFKA-10720: Document prohibition on header mutation by SMTs

Posted by GitBox <gi...@apache.org>.
tombentley commented on pull request #9597:
URL: https://github.com/apache/kafka/pull/9597#issuecomment-727858963


   @kkonstantine @rhauch please could you take look at this trivial PR?
   
   cc @C0urante.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] tombentley commented on pull request #9597: KAFKA-10720: Document prohibition on header mutation by SMTs

Posted by GitBox <gi...@apache.org>.
tombentley commented on pull request #9597:
URL: https://github.com/apache/kafka/pull/9597#issuecomment-734421509


   @kkonstantine @rhauch please could you take look at this trivial PR?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] mimaison merged pull request #9597: KAFKA-10720: Document prohibition on header mutation by SMTs

Posted by GitBox <gi...@apache.org>.
mimaison merged pull request #9597:
URL: https://github.com/apache/kafka/pull/9597


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] C0urante commented on a change in pull request #9597: KAFKA-10720: Document prohibition on header mutation by SMTs

Posted by GitBox <gi...@apache.org>.
C0urante commented on a change in pull request #9597:
URL: https://github.com/apache/kafka/pull/9597#discussion_r524160693



##########
File path: connect/api/src/main/java/org/apache/kafka/connect/transforms/Transformation.java
##########
@@ -33,6 +33,9 @@
      * 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 the headers of a given {@code record}. If the headers need to be changed
+     * a new record with different headers should be created and returned.
+     *

Review comment:
       Should we also make a note about mutating other things such as the key/value of the record, which is possible for `Struct`, `Map`, and `Array` instances?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] C0urante commented on a change in pull request #9597: KAFKA-10720: Document prohibition on header mutation by SMTs

Posted by GitBox <gi...@apache.org>.
C0urante commented on a change in pull request #9597:
URL: https://github.com/apache/kafka/pull/9597#discussion_r524160693



##########
File path: connect/api/src/main/java/org/apache/kafka/connect/transforms/Transformation.java
##########
@@ -33,6 +33,9 @@
      * 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 the headers of a given {@code record}. If the headers need to be changed
+     * a new record with different headers should be created and returned.
+     *

Review comment:
       Should we also make a note about mutating the key/value of the record, which is possible for `Struct`, `Map`, and `Array` instances?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org