private void populateTopicMetadata() {
        List<PartitionInfo> partitions = new ArrayList<>();
        int partitionsPerTopicCount = (memberCount * partitionsToMemberRatio) / topicCount;

        // Create nodes (brokers), one for each rack.
        List<Node> nodes = new ArrayList<>(NUMBER_OF_RACKS);
        for (int i = 0; i < NUMBER_OF_RACKS; i++) {
            nodes.add(new Node(i, "", i, "rack" + i));
        }

        for (int i = 0; i < topicCount; i++) {
            String topicName = "topic" + i;
            allTopicNames.add(topicName);
            partitions.addAll(partitionInfos(topicName, partitionsPerTopicCount, nodes));
        }

        metadata = new Cluster("test-cluster", nodes, partitions, Collections.emptySet(), Collections.emptySet());
    }
The assignment type is decided based on whether all the members are assigned partitions
for the first time (full), or incrementally when a rebalance is triggered.
jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/ClientSideAssignorBenchmark.java