[jira] [Created] (FLINK-11948) When kafka sink parallelism<kafka partition num,kafka data distribution unbalance

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-11948) When kafka sink parallelism<kafka partition num,kafka data distribution unbalance

Shang Yuanchun (Jira)
qi quan created FLINK-11948:
-------------------------------

             Summary: When kafka sink parallelism<kafka partition num,kafka data distribution unbalance
                 Key: FLINK-11948
                 URL: https://issues.apache.org/jira/browse/FLINK-11948
             Project: Flink
          Issue Type: Bug
          Components: Connectors / Kafka
    Affects Versions: 1.7.2, 1.6.4, 1.6.3
            Reporter: qi quan


The default FlinkFixedPartitioner return  int[] partitions by subtaskid % partitions.length.When kafka sink parallelism<kafka partition num。It only the first few kafka partitions will write data.

I think it needs to be improved here.
{code:java}
        @Override
        public int partition(T record, byte[] key, byte[] value, String targetTopic, int[] partitions) {
                Preconditions.checkArgument(
                        partitions != null && partitions.length > 0,
                        "Partitions of the target topic is empty.");

                return partitions[parallelInstanceId % partitions.length];
        }
{code}




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)