Interface KafkaTopicService
-
@DoNotImplement public interface KafkaTopicService
The KafkaTopicService enables the programmatic interaction with Kafka topics. All methods act on the Kafka cluster, that the calling transformer is associated with.- Since:
- 4.4.0
- See Also:
- Kafka Cluster configuration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
KafkaTopicService.KafkaTopicState
KafkaTopicState encodes the current known state of a Kafka topic on the associated cluster.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull KafkaTopicService.KafkaTopicState
createKafkaTopic(@NotNull String topic)
Create a single Kafka topic on the associated cluster.@Immutable @NotNull Map<String,@NotNull KafkaTopicService.KafkaTopicState>
createKafkaTopics(@NotNull Set<@NotNull String> topics)
Create multiple Kafka topics on the associated cluster.@NotNull KafkaTopicService.KafkaTopicState
getKafkaTopicState(@NotNull String topic)
Query the state of a single Kafka topic on the associated cluster.@Immutable @NotNull Map<String,@NotNull KafkaTopicService.KafkaTopicState>
getKafkaTopicStates(@NotNull Set<@NotNull String> topics)
Query the states of multiple Kafka topics on the associated cluster.
-
-
-
Method Detail
-
getKafkaTopicState
@NotNull @NotNull KafkaTopicService.KafkaTopicState getKafkaTopicState(@NotNull @NotNull String topic)
Query the state of a single Kafka topic on the associated cluster.This method can block the calling transformer.
- Parameters:
topic
- The name of a Kafka topic.- Returns:
- The
KafkaTopicService.KafkaTopicState
of the topic. Possible values here areKafkaTopicService.KafkaTopicState.FAILURE
,KafkaTopicService.KafkaTopicState.EXISTS
andKafkaTopicService.KafkaTopicState.MISSING
. - Since:
- 4.4.0
-
getKafkaTopicStates
@Immutable @NotNull @Immutable @NotNull Map<String,@NotNull KafkaTopicService.KafkaTopicState> getKafkaTopicStates(@NotNull @NotNull Set<@NotNull String> topics)
Query the states of multiple Kafka topics on the associated cluster.The returned map contains exactly one entry per queried topic in the argument set.
This method can block the calling transformer.
- Parameters:
topics
- A set containing the names of Kafka topics.- Returns:
- A mapping of the queried Kafka topics to their
KafkaTopicService.KafkaTopicState
. Possible values here areKafkaTopicService.KafkaTopicState.FAILURE
,KafkaTopicService.KafkaTopicState.EXISTS
andKafkaTopicService.KafkaTopicState.MISSING
. - Throws:
NullPointerException
- iftopics
is or contains null.- Since:
- 4.4.0
-
createKafkaTopic
@NotNull @NotNull KafkaTopicService.KafkaTopicState createKafkaTopic(@NotNull @NotNull String topic)
Create a single Kafka topic on the associated cluster. UsegetKafkaTopicState(String)
if you would like to check, whether the topic already exists.This method can block the calling transformer.
- Parameters:
topic
- The name of a new Kafka topic.- Returns:
- The
KafkaTopicService.KafkaTopicState
of the topic after this methods completes. Possible values here areKafkaTopicService.KafkaTopicState.FAILURE
,KafkaTopicService.KafkaTopicState.EXISTS
andKafkaTopicService.KafkaTopicState.CREATED
. - Since:
- 4.4.0
-
createKafkaTopics
@Immutable @NotNull @Immutable @NotNull Map<String,@NotNull KafkaTopicService.KafkaTopicState> createKafkaTopics(@NotNull @NotNull Set<@NotNull String> topics)
Create multiple Kafka topics on the associated cluster. UsegetKafkaTopicStates(Set)
if you would like to check, whether the topics already exists.The returned map contains exactly one entry per given topic in the argument set.
This method can block the calling transformer.
- Parameters:
topics
- A set containing the names of new Kafka topics.- Returns:
- A mapping of the Kafka topics to their
KafkaTopicService.KafkaTopicState
after this method completes. Possible values here areKafkaTopicService.KafkaTopicState.FAILURE
,KafkaTopicService.KafkaTopicState.EXISTS
andKafkaTopicService.KafkaTopicState.CREATED
. - Throws:
NullPointerException
- Iftopics
is or contains null.- Since:
- 4.4.0
-
-