Skip to content
Snippets Groups Projects
Commit 047d3dba authored by Lorenz Boguhn's avatar Lorenz Boguhn
Browse files

Add naive reset Zookeeper

parent a0fb76e0
No related branches found
No related tags found
6 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus,!81Feature/126 kafka communication,!79Feature/127 zookeeper communication,!78Resolve "Implement Quarkus/Kotlin protype"
......@@ -15,5 +15,6 @@ object Main {
run.createTopics(testtopic, 1.toShort())
run.deleteTopics(listOf("test"))
//Quarkus.run()
run.resetZookeeper()
}
}
......@@ -4,7 +4,13 @@ import org.apache.kafka.clients.admin.AdminClient
import org.apache.kafka.clients.admin.AdminClientConfig
import org.apache.kafka.clients.admin.ListTopicsResult
import org.apache.kafka.clients.admin.NewTopic
import org.apache.zookeeper.Watcher
import org.apache.zookeeper.ZooKeeper
import java.util.*
import org.apache.zookeeper.WatchedEvent
class RunUc (){
val bootstrapServer = "my-confluent-cp-zookeeper:2181"
......@@ -52,12 +58,25 @@ class RunUc (){
fun getTopics(): ListTopicsResult? {
return kafkaAdmin.listTopics()
}
fun reset_zookeeper(){
fun resetZookeeper(){
val watcher :Watcher = startWatcher()
val zookeeperclient = ZooKeeper(ip,60, watcher)
zookeeperclient.delete("/workload-generation", -1)
System.out.println("Deletion executed")
}
private fun startWatcher(): Watcher {
return Watcher { event ->
System.out.println(event.toString())
System.out.println(event.state.toString())
}
}
fun start_workload_generator(wg: String, dim_value:Integer, uc_id: String){
}
......
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