[ 
https://issues.apache.org/jira/browse/FLINK-6288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15984402#comment-15984402
 ] 

ASF GitHub Bot commented on FLINK-6288:
---------------------------------------

Github user fanyon commented on the issue:

    https://github.com/apache/flink/pull/3766
  
    @gyfora Thanks for your comment. And right, your question is very good. I 
originally thought that the user must be sure to know all the output topic when 
the job is submitted, but in the real business scenario, the data may be output 
to the dynamically generated topic. 
    
    For the requirementof generate dynamic topic, I propose to adjust the open 
and partition api of KafkaPartitioner as follows:
    1. The open method, remove the parameter int[] partitions, and will be 
opend once for each partitioner
    public void open(int parallelInstanceId, int parallelInstances)
    2. The partition method, add int[] partitions and target topic parameters
    public int partition(T next, byte[] serializedKey, byte[] serializedValue, 
String topic, int[] partitions)
    
    @gyfora @tzulitai What do you think of this? Please feel free to give any 
suggestions, thanks!



> FlinkKafkaProducer's custom Partitioner is always invoked with number of 
> partitions of default topic
> ----------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-6288
>                 URL: https://issues.apache.org/jira/browse/FLINK-6288
>             Project: Flink
>          Issue Type: Improvement
>          Components: Kafka Connector
>            Reporter: Tzu-Li (Gordon) Tai
>            Assignee: Fang Yong
>
> The {{FlinkKafkaProducerBase}} supports routing records to topics besides the 
> default topic, but the custom {{Partitioner}} interface does not follow this 
> semantic.
> The partitioner is always invoked the {{partition}} method with the number of 
> partitions in the default topic, and not the number of partitions of the 
> current {{targetTopic}}.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to