Skip to content
Snippets Groups Projects
Commit 057a3517 authored by Benedikt Wetzel's avatar Benedikt Wetzel Committed by Sören Henning
Browse files

fix creation of Kafka topics

parent 9e0abe50
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!85Introduce new Benchmark class and Patcher,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
......@@ -46,7 +46,7 @@ class KubernetesBenchmark(): Benchmark {
resources = resources.map { r -> r.second },
kafkaConfig = hashMapOf("bootstrap.servers" to kafkaConfig.bootstrapServer),
zookeeperConfig = zookeeperConfig["server"].toString(),
topics = kafkaConfig.topics)
topics = kafkaConfig.getKafkaTopics())
}
}
package theodolite.util
import org.apache.kafka.clients.admin.NewTopic
import kotlin.properties.Delegates
class KafkaConfig() {
lateinit var bootstrapServer: String
lateinit var topics: List<NewTopic>
lateinit var topics: List<TopicWrapper>
fun getKafkaTopics(): List<NewTopic> {
return topics.map { topic -> NewTopic(topic.name, topic.numPartitions, topic.replicationFactor) }
}
class TopicWrapper {
lateinit var name: String
var numPartitions by Delegates.notNull<Int>()
var replicationFactor by Delegates.notNull<Short>()
}
}
\ No newline at end of file
......@@ -21,7 +21,7 @@ kafkaConfig:
bootstrapServer: "localhost:31290"
topics:
- name: "input"
partition: "1"
replication: "1"
numPartitions: 1
replicationFactor: 1
zookeeperConfig:
server: "localhost:31953"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment