Package com.bakdata.kafka.admin
Class TopicsClient.TopicClient
java.lang.Object
com.bakdata.kafka.admin.TopicsClient.TopicClient
- Enclosing class:
- TopicsClient
A client for a specific topic.
-
Method Summary
Modifier and TypeMethodDescriptionconfig()
Create a client for the configuration of this topic.void
create
(TopicSettings settings) Creates a new Kafka topic with the specified number of partitions.void
create
(TopicSettings settings, Map<String, String> config) Creates a new Kafka topic with the specified number of partitions.void
createIfNotExists
(TopicSettings settings) Creates a new Kafka topic with the specified number of partitions if it does not yet exist.void
createIfNotExists
(TopicSettings settings, Map<String, String> config) Creates a new Kafka topic with the specified number of partitions if it does not yet exist.void
delete()
Delete a Kafka topic.void
Delete a Kafka topic only if it exists.Optional<org.apache.kafka.clients.admin.TopicDescription>
describe()
Describe a Kafka topic.boolean
exists()
Checks whether a Kafka topic exists.Get the current settings of a Kafka topic.
-
Method Details
-
createIfNotExists
Creates a new Kafka topic with the specified number of partitions if it does not yet exist. If the topic exists, its configuration is not updated.- Parameters:
settings
- settings for number of partitions and replicationFactorconfig
- topic configuration- See Also:
-
createIfNotExists
Creates a new Kafka topic with the specified number of partitions if it does not yet exist.- Parameters:
settings
- settings for number of partitions and replicationFactor- See Also:
-
delete
public void delete()Delete a Kafka topic. -
getSettings
Get the current settings of a Kafka topic.- Returns:
- settings of topic including number of partitions and replicationFactor
-
exists
public boolean exists()Checks whether a Kafka topic exists.- Returns:
- whether a Kafka topic with the specified name exists or not
-
describe
Describe a Kafka topic.- Returns:
- topic description
-
create
Creates a new Kafka topic with the specified number of partitions.- Parameters:
settings
- settings for number of partitions and replicationFactorconfig
- topic configuration
-
create
Creates a new Kafka topic with the specified number of partitions.- Parameters:
settings
- settings for number of partitions and replicationFactor
-
deleteIfExists
public void deleteIfExists()Delete a Kafka topic only if it exists. -
config
Create a client for the configuration of this topic.- Returns:
- config client
-