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

Read basic configuration for Kafka and Zookeeper

parent 9bac7e0d
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
......@@ -2,12 +2,11 @@ package theodolite.benchmark
import io.fabric8.kubernetes.api.model.KubernetesResource
import io.fabric8.kubernetes.client.DefaultKubernetesClient
import org.apache.kafka.clients.admin.NewTopic
import theodolite.k8s.YamlLoader
import theodolite.patcher.PatcherManager
import theodolite.util.LoadDimension
import theodolite.util.OverridePatcherDefinition
import theodolite.util.Resource
import theodolite.util.TypeName
import theodolite.util.*
import java.util.*
class KubernetesBenchmark(): Benchmark {
lateinit var name: String
......@@ -15,6 +14,8 @@ class KubernetesBenchmark(): Benchmark {
lateinit var loadGenResource: List<String>
lateinit var resourceTypes: List<TypeName>
lateinit var loadTypes: List<TypeName>
lateinit var kafkaConfig: KafkaConfig
lateinit var zookeeperConfig: HashMap<String,String>
......@@ -45,9 +46,13 @@ class KubernetesBenchmark(): Benchmark {
// patch overrides
overrides.forEach {override -> patcherManager.applyPatcher(override, resources)}
println(zookeeperConfig["server"] !! )
resources.forEach {x -> println(x)}
return KubernetesBenchmarkDeployment(emptyList(), hashMapOf<String, Any>(), "", emptyList())
return KubernetesBenchmarkDeployment(
resources.map { r -> r.second },
kafkaConfig = hashMapOf("bootstrap.servers" to kafkaConfig.bootstrapSever),
zookeeperConfig = zookeeperConfig["server"].toString() !!,
topics = kafkaConfig.topics.map { topic -> NewTopic(topic.name, topic.partition, topic.replication ) })
}
}
......@@ -6,6 +6,7 @@ import org.apache.kafka.clients.admin.NewTopic
import theodolite.k8s.K8sManager
import theodolite.k8s.TopicManager
import theodolite.k8s.WorkloadGeneratorStateCleaner
import java.util.*
class KubernetesBenchmarkDeployment(
val resources: List<KubernetesResource>, // List of already patched resources
......
package theodolite.util
import kotlin.properties.Delegates
class KafkaConfig() {
lateinit var bootstrapSever: String
lateinit var topics: List<Topic>
class Topic() {
lateinit var name: String
var partition by Delegates.notNull<Int>()
var replication by Delegates.notNull<Short>()
}
}
\ No newline at end of file
......@@ -15,4 +15,12 @@ loadTypes:
- type: "EnvVarPatcher"
resource: "workloadGenerator.yaml"
container: "workload-generator"
variableName: "NUM_SENSORS"
\ No newline at end of file
variableName: "NUM_SENSORS"
kafkaConfig:
bootstrapSever: "my-confluent-cp-kafka:9092"
topics:
- name: "test"
partition: "1"
replication: "1"
zookeeperConfig:
server: "my-confluent-cp-zookeeper:2181"
\ No newline at end of file
......@@ -21,4 +21,4 @@ configOverrides:
container: "workload-generator"
overrides:
overrideTestA: "8888"
overrideTestB: "6666"
overrideTestB: "6666"
\ 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