Range partitioning works on a per-topic basis. For each topic, we lay out the available partitions in numeric order
and the consumer threads in lexicographic order. We then divide the number of partitions by the total number of
consumer streams (threads) to determine the number of partitions to assign to each consumer. If it does not evenly
divide, then the first few consumers will have one extra partition. For example, suppose there are two consumers C1
and C2 with two streams each, and there are five available partitions (p0, p1, p2, p3, p4). So each consumer thread
will get at least one partition and the first consumer thread will get one extra partition. So the assignment will be:
p0 -> C1-0, p1 -> C1-0, p2 -> C1-1, p3 -> C2-0, p4 -> C2-1
Range partitioning works on a per-topic basis. For each topic, we lay out the available partitions in numeric order and the consumer threads in lexicographic order. We then divide the number of partitions by the total number of consumer streams (threads) to determine the number of partitions to assign to each consumer. If it does not evenly divide, then the first few consumers will have one extra partition. For example, suppose there are two consumers C1 and C2 with two streams each, and there are five available partitions (p0, p1, p2, p3, p4). So each consumer thread will get at least one partition and the first consumer thread will get one extra partition. So the assignment will be: p0 -> C1-0, p1 -> C1-0, p2 -> C1-1, p3 -> C2-0, p4 -> C2-1