becketqin commented on issue #8535: [FLINK-11693] Add KafkaSerializationSchema 
that uses ProducerRecord
URL: https://github.com/apache/flink/pull/8535#issuecomment-505687127
 
 
   @aljoscha Yes, you are right. We are not able to change the partition once 
the `ProducerRecrod` is there. We will have to create another `ProducerRecord` 
in order to do that, but that will result in some overhead. Introducing a 
context sounds reasonable to me. This has an extra benefit of allowing context 
aware serialization. There might be two flavors of doing this. 
   
   1. Pass the context as a method argument.
   2. A `ContextAware` interface like `RichFunction`, with a `setContext()` and 
`getContext()` method.
   
   Personally I slightly prefer flavor 2, because it avoid keeping the Context 
object outside of the class which actually uses it. But I don't have a strong 
opinion on this.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to