Class InternalTopologyBuilder
- java.lang.Object
-
- org.apache.kafka.streams.processor.internals.InternalTopologyBuilder
-
public class InternalTopologyBuilder extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InternalTopologyBuilder.AbstractNode
static class
InternalTopologyBuilder.GlobalStore
static class
InternalTopologyBuilder.Processor
static class
InternalTopologyBuilder.Sink<K,V>
static class
InternalTopologyBuilder.Source
static class
InternalTopologyBuilder.StateStoreFactory<S extends StateStore>
static class
InternalTopologyBuilder.Subtopology
static class
InternalTopologyBuilder.TopicsInfo
static class
InternalTopologyBuilder.TopologyDescription
-
Constructor Summary
Constructors Constructor Description InternalTopologyBuilder()
-
Method Summary
-
-
-
Method Detail
-
setApplicationIdAndInternalStream
public final InternalTopologyBuilder setApplicationIdAndInternalStream(String applicationId, String internalStream, String internalStreamCompacted)
-
rewriteTopology
public final InternalTopologyBuilder rewriteTopology(StreamsConfig config)
-
setDefaultStream
public final void setDefaultStream(String defaultStream)
-
addSource
public final void addSource(Topology.AutoOffsetReset offsetReset, String name, TimestampExtractor timestampExtractor, Deserializer<?> keyDeserializer, Deserializer<?> valDeserializer, String... topics)
-
addSource
public final void addSource(Topology.AutoOffsetReset offsetReset, String name, TimestampExtractor timestampExtractor, Deserializer<?> keyDeserializer, Deserializer<?> valDeserializer, Pattern topicPattern)
-
addSink
public final <K,V> void addSink(String name, String topic, Serializer<K> keySerializer, Serializer<V> valSerializer, StreamPartitioner<? super K,? super V> partitioner, String... predecessorNames)
-
addSink
public final <K,V> void addSink(String name, TopicNameExtractor<K,V> topicExtractor, Serializer<K> keySerializer, Serializer<V> valSerializer, StreamPartitioner<? super K,? super V> partitioner, String... predecessorNames)
-
addProcessor
public final void addProcessor(String name, ProcessorSupplier<?,?> supplier, String... predecessorNames)
-
addStateStore
public final void addStateStore(StoreBuilder<?> storeBuilder, String... processorNames)
-
addStateStore
public final void addStateStore(StoreBuilder<?> storeBuilder, boolean allowOverride, String... processorNames)
-
addGlobalStore
public final <K,V> void addGlobalStore(StoreBuilder<?> storeBuilder, String sourceName, TimestampExtractor timestampExtractor, Deserializer<K> keyDeserializer, Deserializer<V> valueDeserializer, String topic, String processorName, ProcessorSupplier<K,V> stateUpdateSupplier)
-
connectProcessorAndStateStores
public final void connectProcessorAndStateStores(String processorName, String... stateStoreNames)
-
connectSourceStoreAndTopic
public void connectSourceStoreAndTopic(String sourceStoreName, String topic)
-
addInternalTopic
public final void addInternalTopic(String topicName, InternalTopicProperties internalTopicProperties)
-
copartitionSources
public final void copartitionSources(Collection<String> sourceNodes)
-
maybeUpdateCopartitionSourceGroups
public final void maybeUpdateCopartitionSourceGroups(String replacedNodeName, String optimizedNodeName)
-
validateCopartition
public void validateCopartition()
-
buildTopology
public ProcessorTopology buildTopology()
- Returns:
- the full topology minus any global state
-
buildSubtopology
public ProcessorTopology buildSubtopology(int topicGroupId)
- Parameters:
topicGroupId
- group of topics corresponding to a single subtopology- Returns:
- subset of the full topology
-
buildGlobalStateTopology
public ProcessorTopology buildGlobalStateTopology()
Builds the topology for any global state stores- Returns:
- ProcessorTopology of global state
-
globalStateStores
public Map<String,StateStore> globalStateStores()
Get any globalStateStore
s that are part of the topology- Returns:
- map containing all global
StateStore
s
-
topicGroups
public Map<Integer,InternalTopologyBuilder.TopicsInfo> topicGroups()
Returns the map of topic groups keyed by the group id. A topic group is a group of topics in the same task.- Returns:
- groups of topic names
-
earliestResetTopicsPattern
public Pattern earliestResetTopicsPattern()
-
latestResetTopicsPattern
public Pattern latestResetTopicsPattern()
-
sourceTopicsForStore
public Collection<String> sourceTopicsForStore(String storeName)
-
copartitionGroups
public Collection<Set<String>> copartitionGroups()
-
hasNoNonGlobalTopology
public boolean hasNoNonGlobalTopology()
-
describe
public InternalTopologyBuilder.TopologyDescription describe()
-
stateStores
public Map<String,InternalTopologyBuilder.StateStoreFactory<?>> stateStores()
-
-