airflow.providers.apache.kafka.hooks.client

Module Contents

Classes

KafkaAdminClientHook

A hook for interacting with the Kafka Cluster.

class airflow.providers.apache.kafka.hooks.client.KafkaAdminClientHook(kafka_config_id=KafkaBaseHook.default_conn_name)[source]

Bases: airflow.providers.apache.kafka.hooks.base.KafkaBaseHook

A hook for interacting with the Kafka Cluster.

Parameters

kafka_config_id – The connection object to use, defaults to “kafka_default”

create_topic(topics)[source]

Create a topic.

Parameters

topics (Sequence[Sequence[Any]]) – a list of topics to create including the number of partitions for the topic and the replication factor. Format: [ (“topic_name”, number of partitions, replication factor)]

delete_topic(topics)[source]

Delete a topic.

Parameters

topics (Sequence[str]) – a list of topics to delete.

Was this entry helpful?