becketqin commented on a change in pull request #8535: [FLINK-11693] Add 
KafkaSerializationSchema that uses ProducerRecord
URL: https://github.com/apache/flink/pull/8535#discussion_r294625276
 
 

 ##########
 File path: 
flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducer.java
 ##########
 @@ -495,6 +520,11 @@ public FlinkKafkaProducer(
                this.schema = checkNotNull(serializationSchema, 
"serializationSchema is null");
                this.producerConfig = checkNotNull(producerConfig, 
"producerConfig is null");
                this.flinkKafkaPartitioner = checkNotNull(customPartitioner, 
"customPartitioner is null").orElse(null);
+               if (customPartitioner.isPresent()) {
 
 Review comment:
   Hmm, not sure if `KafkaSerializationSchema` can fully replace the 
partitioner. The current API does not provide number of partitions in 
`KafkaSerializationSchema.serialize()`, right? So the serializer will not be 
able to know the total number of partitions. Should we add that to the method 
arguments?

----------------------------------------------------------------
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