public class KStreamBuilder extends TopologyBuilder
TopologyBuilder
that provides the KStream
DSL
for users to specify computational logic and translates the given logic to a processor topology.TopologyBuilder.TopicsInfo
Constructor and Description |
---|
KStreamBuilder() |
Modifier and Type | Method and Description |
---|---|
<K,V> KStream<K,V> |
merge(KStream<K,V>... streams)
Creates a new stream by merging the given streams
|
java.lang.String |
newName(java.lang.String prefix)
Create a unique processor name used for translation into the processor topology.
|
<K,V> KStream<K,V> |
stream(org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer,
org.apache.kafka.common.serialization.Deserializer<V> valDeserializer,
java.lang.String... topics)
Creates a KStream instance for the specified topic.
|
<K,V> KStream<K,V> |
stream(java.lang.String... topics)
Creates a KStream instance for the specified topic.
|
<K,V> KTable<K,V> |
table(org.apache.kafka.common.serialization.Serializer<K> keySerializer,
org.apache.kafka.common.serialization.Serializer<V> valSerializer,
org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer,
org.apache.kafka.common.serialization.Deserializer<V> valDeserializer,
java.lang.String topic)
Creates a KTable instance for the specified topic.
|
<K,V> KTable<K,V> |
table(java.lang.String topic)
Creates a KTable instance for the specified topic.
|
addInternalTopic, addProcessor, addSink, addSink, addSink, addSink, addSource, addSource, addStateStore, addStateStore, build, connectProcessorAndStateStores, connectProcessors, copartitionGroups, copartitionSources, nodeGroups, sourceTopics, topicGroups
public <K,V> KStream<K,V> stream(java.lang.String... topics)
topics
- the topic names, if empty default to all the topics in the configpublic <K,V> KStream<K,V> stream(org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer, org.apache.kafka.common.serialization.Deserializer<V> valDeserializer, java.lang.String... topics)
keyDeserializer
- key deserializer used to read this source KStream,
if not specified the default deserializer defined in the configs will be usedvalDeserializer
- value deserializer used to read this source KStream,
if not specified the default deserializer defined in the configs will be usedtopics
- the topic names, if empty default to all the topics in the configpublic <K,V> KTable<K,V> table(java.lang.String topic)
topic
- the topic namepublic <K,V> KTable<K,V> table(org.apache.kafka.common.serialization.Serializer<K> keySerializer, org.apache.kafka.common.serialization.Serializer<V> valSerializer, org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer, org.apache.kafka.common.serialization.Deserializer<V> valDeserializer, java.lang.String topic)
keySerializer
- key serializer used to send key-value pairs,
if not specified the default key serializer defined in the configuration will be usedvalSerializer
- value serializer used to send key-value pairs,
if not specified the default value serializer defined in the configuration will be usedkeyDeserializer
- key deserializer used to read this source KStream,
if not specified the default deserializer defined in the configs will be usedvalDeserializer
- value deserializer used to read this source KStream,
if not specified the default deserializer defined in the configs will be usedtopic
- the topic namepublic <K,V> KStream<K,V> merge(KStream<K,V>... streams)
streams
- the streams to be mergedpublic java.lang.String newName(java.lang.String prefix)
prefix
- Processor name prefix.