public class TopicPatternResolver extends java.lang.Object implements TopicResolver
configure(Map) later. The parameters passed in during configure() determine the behaviour of
the resolver. The class implements the TopicResolver interface.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TOPIC_PATTERN_CONFIG
The name of the property used to pass in the topic name pattern.
|
DEFAULT_PREFIX| Constructor and Description |
|---|
TopicPatternResolver() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(java.util.Map<java.lang.String,?> configs) |
java.lang.String |
getNameFromContext(java.util.Map<java.lang.String,java.lang.String> context)
Fetches the unresolved name from a context that was parsed earlier.
|
java.lang.String |
resolve(java.lang.String topic)
Translates the internal representation of name to the external one.
|
java.lang.String |
resolveTopic(java.lang.String topic)
Translates the internal representation of topic name to the external one.
|
org.apache.kafka.common.TopicPartition |
resolveTopic(org.apache.kafka.common.TopicPartition topicPartition)
Translates the internal representation of topic name to the external one.
|
java.util.Set<org.apache.kafka.common.TopicPartition> |
resolveTopicPartitions(java.util.Collection<org.apache.kafka.common.TopicPartition> topicPartitions)
Translates the internal representation of topic partitions to the external ones.
|
java.util.regex.Pattern |
resolveTopicPattern(java.util.regex.Pattern pattern)
Translates the internal representation of topic pattern to the external one.
|
java.util.Set<java.lang.String> |
resolveTopics(java.util.Collection<java.lang.String> topics)
Translates the internal representation of topic names to the external ones.
|
<V> java.util.Map<org.apache.kafka.common.TopicPartition,V> |
resolveTopics(java.util.Map<org.apache.kafka.common.TopicPartition,V> topicPartitionMap)
Translates the internal representation of a topic partition map to the external one.
|
java.lang.String |
unresolve(java.lang.String topic)
Translates the external representation of name to the internal one.
|
java.util.Map<java.lang.String,java.lang.String> |
unresolveContext(java.lang.String topicName)
Translates the external representation of a name to the internal one, returning a map of all
parsed fields.
|
java.lang.String |
unresolveTopic(java.lang.String topic)
Translates the external representation of topic name to the internal one.
|
org.apache.kafka.common.TopicPartition |
unresolveTopic(org.apache.kafka.common.TopicPartition topicPartition)
Translates the external representation of topic partition to the internal one.
|
java.util.Set<org.apache.kafka.common.TopicPartition> |
unresolveTopicPartitions(java.util.Collection<org.apache.kafka.common.TopicPartition> topicPartitions)
Translates the external representation of topic partitions to the internal ones.
|
java.util.Set<java.lang.String> |
unresolveTopics(java.util.Collection<java.lang.String> topics)
Translates the external representation of topic names to the internal ones.
|
<V> java.util.Map<org.apache.kafka.common.TopicPartition,V> |
unresolveTopics(java.util.Map<org.apache.kafka.common.TopicPartition,V> topicPartitionMap)
Translates the external representation of topic partition to the internal one.
|
public static final java.lang.String TOPIC_PATTERN_CONFIG
public void configure(java.util.Map<java.lang.String,?> configs)
public java.lang.String resolve(java.lang.String topic)
Resolverpublic java.lang.String unresolve(java.lang.String topic)
Resolverpublic java.util.Map<java.lang.String,java.lang.String> unresolveContext(java.lang.String topicName)
ResolverunresolveContext in interface ResolvertopicName - the external namepublic java.lang.String getNameFromContext(java.util.Map<java.lang.String,java.lang.String> context)
ResolvergetNameFromContext in interface Resolvercontext - the unresolved contextpublic java.lang.String resolveTopic(java.lang.String topic)
TopicResolverresolveTopic in interface TopicResolvertopic - the application's internal topic namepublic org.apache.kafka.common.TopicPartition resolveTopic(org.apache.kafka.common.TopicPartition topicPartition)
TopicResolverresolveTopic in interface TopicResolvertopicPartition - the application's internal topic partitionpublic java.util.regex.Pattern resolveTopicPattern(java.util.regex.Pattern pattern)
TopicResolverresolveTopicPattern in interface TopicResolverpattern - the application's internal topic patternpublic java.util.Set<java.lang.String> resolveTopics(java.util.Collection<java.lang.String> topics)
TopicResolverresolveTopics in interface TopicResolvertopics - the application's internal topic namespublic java.util.Set<org.apache.kafka.common.TopicPartition> resolveTopicPartitions(java.util.Collection<org.apache.kafka.common.TopicPartition> topicPartitions)
TopicResolverresolveTopicPartitions in interface TopicResolvertopicPartitions - the application's internal topic partitionspublic <V> java.util.Map<org.apache.kafka.common.TopicPartition,V> resolveTopics(java.util.Map<org.apache.kafka.common.TopicPartition,V> topicPartitionMap)
TopicResolverresolveTopics in interface TopicResolverV - any type used as Value in the MaptopicPartitionMap - the map containing the application's internal topic partitions as
Keyspublic java.lang.String unresolveTopic(java.lang.String topic)
TopicResolverunresolveTopic in interface TopicResolvertopic - the external topic namepublic org.apache.kafka.common.TopicPartition unresolveTopic(org.apache.kafka.common.TopicPartition topicPartition)
TopicResolverunresolveTopic in interface TopicResolvertopicPartition - the external topic partitionpublic java.util.Set<java.lang.String> unresolveTopics(java.util.Collection<java.lang.String> topics)
TopicResolverunresolveTopics in interface TopicResolvertopics - the external topic namespublic java.util.Set<org.apache.kafka.common.TopicPartition> unresolveTopicPartitions(java.util.Collection<org.apache.kafka.common.TopicPartition> topicPartitions)
TopicResolverunresolveTopicPartitions in interface TopicResolvertopicPartitions - the external topic partitionspublic <V> java.util.Map<org.apache.kafka.common.TopicPartition,V> unresolveTopics(java.util.Map<org.apache.kafka.common.TopicPartition,V> topicPartitionMap)
TopicResolverunresolveTopics in interface TopicResolverV - any type used as Value in the MaptopicPartitionMap - the map containing the application's external topic partitions as
keysCopyright © 2020 Axual B.V.. All rights reserved.