private Map<Uuid, TopicMetadata> createTopicMetadata() {
        MetadataDelta delta = new MetadataDelta(MetadataImage.EMPTY);
        Map<Uuid, TopicMetadata> topicMetadata = new HashMap<>();
        int partitionsPerTopicCount = (memberCount * partitionsToMemberRatio) / topicCount;

        Map<Integer, Set<String>> partitionRacks = isRackAware ?
            mkMapOfPartitionRacks(partitionsPerTopicCount) :
            Collections.emptyMap();

        for (int i = 0; i < topicCount; i++) {
            Uuid topicUuid = Uuid.randomUuid();
            String topicName = "topic" + i;
            allTopicNames.add(topicName);
            topicMetadata.put(topicUuid, new TopicMetadata(
                topicUuid,
                topicName,
                partitionsPerTopicCount,
                partitionRacks
            ));

            AssignorBenchmarkUtils.addTopic(
                delta,
                topicUuid,
                topicName,
                partitionsPerTopicCount
            );
        }

        topicsImage = delta.apply(MetadataProvenance.EMPTY).topics();
        return topicMetadata;
    }
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/ServerSideAssignorBenchmark.java