Class KafkaController
- java.lang.Object
-
- io.debezium.testing.openshift.tools.kafka.KafkaController
-
public class KafkaController extends Object
This class provides control over Kafka instance deployed in OpenShift- Author:
- Jakub Cechacek
-
-
Constructor Summary
Constructors Constructor Description KafkaController(io.strimzi.api.kafka.model.Kafka kafka, io.fabric8.openshift.client.OpenShiftClient ocp, okhttp3.OkHttpClient http)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.strimzi.api.kafka.model.KafkaTopicdeployTopic(String yamlPath)StringgetKafkaBootstrapAddress()private io.fabric8.kubernetes.client.dsl.NonNamespaceOperation<io.strimzi.api.kafka.model.KafkaTopic,io.strimzi.api.kafka.KafkaTopicList,io.fabric8.kubernetes.client.dsl.Resource<io.strimzi.api.kafka.model.KafkaTopic>>topicOperation()booleanundeployCluster()Undeploy this Kafka cluster by deleted related KafkaConnect CRio.strimzi.api.kafka.model.KafkaTopicwaitForKafkaTopic(String name)Waits until topic is properly deployed.
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
kafka
private final io.strimzi.api.kafka.model.Kafka kafka
-
ocp
private final io.fabric8.openshift.client.OpenShiftClient ocp
-
http
private final okhttp3.OkHttpClient http
-
project
private final String project
-
ocpUtils
private final OpenShiftUtils ocpUtils
-
-
Method Detail
-
getKafkaBootstrapAddress
public String getKafkaBootstrapAddress()
- Returns:
- host and port for public bootstrap service
-
deployTopic
public io.strimzi.api.kafka.model.KafkaTopic deployTopic(String yamlPath) throws InterruptedException
- Throws:
InterruptedException
-
undeployCluster
public boolean undeployCluster()
Undeploy this Kafka cluster by deleted related KafkaConnect CR- Returns:
- true if the CR was found and deleted
-
waitForKafkaTopic
public io.strimzi.api.kafka.model.KafkaTopic waitForKafkaTopic(String name) throws InterruptedException
Waits until topic is properly deployed.- Parameters:
name- name of the topic- Throws:
InterruptedException- on wait errorIllegalArgumentException- when deployment doesn't use custom resources
-
topicOperation
private io.fabric8.kubernetes.client.dsl.NonNamespaceOperation<io.strimzi.api.kafka.model.KafkaTopic,io.strimzi.api.kafka.KafkaTopicList,io.fabric8.kubernetes.client.dsl.Resource<io.strimzi.api.kafka.model.KafkaTopic>> topicOperation()
-
-