Class OcpKafkaController
- java.lang.Object
-
- io.debezium.testing.openshift.tools.kafka.OcpKafkaController
-
- All Implemented Interfaces:
KafkaController
public class OcpKafkaController extends Object implements KafkaController
This class provides control over Kafka instance deployed in OpenShift- Author:
- Jakub Cechacek
-
-
Constructor Summary
Constructors Constructor Description OcpKafkaController(io.strimzi.api.kafka.model.Kafka kafka, io.fabric8.openshift.client.OpenShiftClient ocp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.strimzi.api.kafka.model.KafkaTopicdeployTopic(String yamlPath)Deploy kafka topic from given CRStringgetKafkaBootstrapAddress()private io.fabric8.kubernetes.client.dsl.NonNamespaceOperation<io.strimzi.api.kafka.model.Kafka,io.strimzi.api.kafka.KafkaList,io.fabric8.kubernetes.client.dsl.Resource<io.strimzi.api.kafka.model.Kafka>>kafkaOperation()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()booleanundeploy()Undeploy this Kafka clustervoidwaitForCluster()Waits for cluster to be availableprivate io.strimzi.api.kafka.model.KafkaTopicwaitForKafkaTopic(String name)Waits until topic is properly deployed.
-
-
-
Method Detail
-
getKafkaBootstrapAddress
public String getKafkaBootstrapAddress()
- Specified by:
getKafkaBootstrapAddressin interfaceKafkaController- Returns:
- host and port for public bootstrap service
-
deployTopic
public io.strimzi.api.kafka.model.KafkaTopic deployTopic(String yamlPath) throws InterruptedException
Deploy kafka topic from given CR- Parameters:
yamlPath- path to yaml descript- Returns:
- created topic
- Throws:
InterruptedException
-
undeploy
public boolean undeploy()
Description copied from interface:KafkaControllerUndeploy this Kafka cluster- Specified by:
undeployin interfaceKafkaController- Returns:
- true on operation success
-
waitForCluster
public void waitForCluster() throws InterruptedExceptionDescription copied from interface:KafkaControllerWaits for cluster to be available- Specified by:
waitForClusterin interfaceKafkaController- Throws:
InterruptedException
-
waitForKafkaTopic
private 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()
-
kafkaOperation
private io.fabric8.kubernetes.client.dsl.NonNamespaceOperation<io.strimzi.api.kafka.model.Kafka,io.strimzi.api.kafka.KafkaList,io.fabric8.kubernetes.client.dsl.Resource<io.strimzi.api.kafka.model.Kafka>> kafkaOperation()
-
-