Skip to content
Snippets Groups Projects
Commit d48c9dd5 authored by Benedikt Wetzel's avatar Benedikt Wetzel
Browse files

fix creation of Kafka topics

parent 7cf3de30
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 { ...@@ -46,7 +46,7 @@ class KubernetesBenchmark(): Benchmark {
resources = resources.map { r -> r.second }, resources = resources.map { r -> r.second },
kafkaConfig = hashMapOf("bootstrap.servers" to kafkaConfig.bootstrapServer), kafkaConfig = hashMapOf("bootstrap.servers" to kafkaConfig.bootstrapServer),
zookeeperConfig = zookeeperConfig["server"].toString(), zookeeperConfig = zookeeperConfig["server"].toString(),
topics = kafkaConfig.topics) topics = kafkaConfig.getKafkaTopics())
} }
} }
package theodolite.util package theodolite.util
import org.apache.kafka.clients.admin.NewTopic import org.apache.kafka.clients.admin.NewTopic
import kotlin.properties.Delegates
class KafkaConfig() { class KafkaConfig() {
lateinit var bootstrapServer: String 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: ...@@ -21,7 +21,7 @@ kafkaConfig:
bootstrapServer: "localhost:31290" bootstrapServer: "localhost:31290"
topics: topics:
- name: "input" - name: "input"
partition: "1" numPartitions: 1
replication: "1" replicationFactor: 1
zookeeperConfig: zookeeperConfig:
server: "localhost:31953" 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