Class RoundRobinPartitionDistributor

java.lang.Object
io.camunda.zeebe.broker.partitioning.distribution.RoundRobinPartitionDistributor
All Implemented Interfaces:
PartitionDistributor

public final class RoundRobinPartitionDistributor extends Object implements PartitionDistributor
This implementation of PartitionDistributor distributes the partitions in a round robin fashion over the set of members in the cluster.

Example distribution with 4 members, 5 partitions, and a replication factor of 3

 +------------------+----+----+----+---+
 | Partition \ Node | 0  | 1  | 2  | 3 |
 +------------------+----+----+----+---+
 |                1 | 3  | 2  | 1  |   |
 |                2 |    | 3  | 2  | 1 |
 |                3 | 1  |    | 3  | 2 |
 |                4 | 2  | 1  |    | 3 |
 |                5 | 3  | 1  | 2  |   |
 +------------------+----+----+----+---+