Class FlinkFixedPartitioner<T>
java.lang.Object
org.apache.flink.streaming.connectors.kafka.partitioner.FlinkKafkaPartitioner<T>
org.apache.flink.streaming.connectors.kafka.partitioner.FlinkFixedPartitioner<T>
- All Implemented Interfaces:
Serializable,KafkaPartitioner<T>
Deprecated.
A partitioner ensuring that each internal Flink partition ends up in one Kafka partition.
Note, one Kafka partition can contain multiple Flink partitions.
There are a couple of cases to consider.
More Flink partitions than kafka partitions
Flink Sinks: Kafka Partitions
1 ----------------> 1
2 --------------/
3 -------------/
4 ------------/
Some (or all) kafka partitions contain the output of more than one flink partition
Fewer Flink partitions than Kafka
Flink Sinks: Kafka Partitions
1 ----------------> 1
2 ----------------> 2
3
4
5
Not all Kafka partitions contain data To avoid such an unbalanced partitioning, use a round-robin kafka partitioner (note that this will cause a lot of network connections between all the Flink instances and all the Kafka brokers).
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
FlinkFixedPartitioner
public FlinkFixedPartitioner()Deprecated.
-
-
Method Details
-
open
public void open(int parallelInstanceId, int parallelInstances) Deprecated.Description copied from interface:KafkaPartitionerInitializer for the partitioner. This is called once on each parallel sink instance of the Flink Kafka producer. This method should be overridden if necessary.- Parameters:
parallelInstanceId- 0-indexed id of the parallel sink instance in FlinkparallelInstances- the total number of parallel instances
-
partition
Deprecated.Description copied from interface:KafkaPartitionerDetermine the id of the partition that the record should be written to.- Parameters:
record- the record valuekey- serialized key of the recordvalue- serialized value of the recordtargetTopic- target topic for the recordpartitions- found partitions for the target topic- Returns:
- the id of the target partition
-
equals
Deprecated. -
hashCode
public int hashCode()Deprecated.
-
FlinkKafkaProduceris removed.