Package com.hazelcast.jet.kafka
Class TopicsConfig
- java.lang.Object
-
- com.hazelcast.jet.kafka.TopicsConfig
-
- All Implemented Interfaces:
java.io.Serializable
public class TopicsConfig extends java.lang.Object implements java.io.Serializable
Contains the configuration for all Kafka topics that will be consumed by the Kafka source processor.- Since:
- 5.3
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TopicsConfig.TopicConfig
Contains the configuration for a single Kafka topic.
-
Constructor Summary
Constructors Constructor Description TopicsConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TopicsConfig
addTopic(java.lang.String topicName)
Creates empty topic configuration and saves it in the map under the topic name.TopicsConfig
addTopicConfig(TopicsConfig.TopicConfig config)
Adds the topic configuration.TopicsConfig
addTopics(java.util.List<java.lang.String> topicNames)
Creates new topic configurations for every provided topic from the list and saves them in the map.java.lang.Long
getInitialOffsetFor(java.lang.String topicName, int partition)
Returns initial offset value for the given topic and partition combination.TopicsConfig.TopicConfig
getTopicConfig(java.lang.String topicName)
Returns the topic configuration for given topic.java.util.Map<java.lang.String,TopicsConfig.TopicConfig>
getTopicConfigs()
Returns the map of topic configurations, mapped by topic name.java.util.Set<java.lang.String>
getTopicNames()
Returns the set of topic names from topic configurations.java.lang.String
toString()
-
-
-
Method Detail
-
getTopicConfigs
public java.util.Map<java.lang.String,TopicsConfig.TopicConfig> getTopicConfigs()
Returns the map of topic configurations, mapped by topic name.
-
getTopicNames
public java.util.Set<java.lang.String> getTopicNames()
Returns the set of topic names from topic configurations. Returned set of topic names is guaranteed to preserve the order of insertion of topic configurations that were added viaaddTopicConfig(TopicConfig)
oraddTopic(String)
-
getTopicConfig
@Nullable public TopicsConfig.TopicConfig getTopicConfig(java.lang.String topicName)
Returns the topic configuration for given topic.
-
addTopicConfig
public TopicsConfig addTopicConfig(TopicsConfig.TopicConfig config)
Adds the topic configuration. The configuration is saved under the topic name.
-
addTopic
public TopicsConfig addTopic(java.lang.String topicName)
Creates empty topic configuration and saves it in the map under the topic name.
-
addTopics
public TopicsConfig addTopics(java.util.List<java.lang.String> topicNames)
Creates new topic configurations for every provided topic from the list and saves them in the map.
-
getInitialOffsetFor
@Nullable public java.lang.Long getInitialOffsetFor(java.lang.String topicName, int partition)
Returns initial offset value for the given topic and partition combination. If configuration for specified topic does not exist, or if initial offset is not defined for the given partition thennull
is returned.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-