diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/Main.kt b/theodolite-quarkus/src/main/kotlin/theodolite/Main.kt index 705d18a251bb0c4c57f90d008feb17b7e603a4d1..e83c7bdff3406e73c6cb20d9d7d3fd570aff98a9 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/Main.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/Main.kt @@ -15,5 +15,6 @@ object Main { run.createTopics(testtopic, 1.toShort()) run.deleteTopics(listOf("test")) //Quarkus.run() + run.resetZookeeper() } } diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/RunUc.kt b/theodolite-quarkus/src/main/kotlin/theodolite/RunUc.kt index c88bc17f0ca243e48b97be832122c18db6da00fd..d9d0071dd0fd82acff574be67ea3799663311c77 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/RunUc.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/RunUc.kt @@ -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){ }