You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
== [[Topology]] Topology --Directed Acyclic Graph of Stream Processing Nodes
2
2
3
-
`Topology` is an*directed acyclic graph of processors* (aka _DAG of stream processing nodes_) that represents the stream processing logic of a Kafka Streams application.
3
+
`Topology` is a*directed acyclic graph of stream processing nodes* that represents the stream processing logic of a Kafka Streams application.
4
4
5
-
`Topology` is a logical representation of a <<kafka-streams-internals-ProcessorTopology.adoc#, ProcessorTopology>>.
6
-
7
-
`Topology` provides the <<operators, fluent API>> to <<creating-instance, create a processing topology>> of <<addStateStore, local>> and <<addGlobalStore, global>> state stores, <<addSource, sources>>, <<addProcessor, processors>> and <<addSink, sinks>>.
5
+
`Topology` can be <<creating-instance, created>> directly (as part of <<kafka-streams-processor-api.adoc#, Low-Level Processor API>>) or indirectly using <<kafka-streams-streams-dsl.adoc#, Streams DSL -- High-Level Stream Processing DSL>>.
8
6
9
-
`Topology`can be <<creating-instance, created>> directly or indirectly using <<kafka-streams-streams-dsl.adoc#, Streams DSL -- High-Level Stream Processing DSL>>.
7
+
`Topology`provides the <<operators, fluent API>> to add <<addStateStore, local>> and <<addGlobalStore, global>> state stores, <<addSource, sources>>, <<addProcessor, processors>> and <<addSink, sinks>> to build advanced stream processing graphs.
10
8
11
9
[[creating-instance]]
12
10
`Topology` takes no arguments when created.
@@ -79,11 +77,7 @@ Topologies:
79
77
<-- demo-source-processor
80
78
----
81
79
82
-
[[AutoOffsetReset]]
83
-
`Topology` defines *offset reset policy* (`AutoOffsetReset`) that can be one of the two possible values:
84
-
85
-
* [[EARLIEST]] `EARLIEST`
86
-
* [[LATEST]] `LATEST`
80
+
`Topology` is a logical representation of a <<kafka-streams-internals-ProcessorTopology.adoc#, ProcessorTopology>>.
87
81
88
82
[[operators]]
89
83
.Topology API / Methods
@@ -98,169 +92,177 @@ a| [[addGlobalStore]]
98
92
[source, java]
99
93
----
100
94
Topology addGlobalStore(
101
-
final StoreBuilder storeBuilder,
102
-
final String sourceName,
103
-
final Deserializer keyDeserializer,
104
-
final Deserializer valueDeserializer,
105
-
final String topic,
106
-
final String processorName,
107
-
final ProcessorSupplier stateUpdateSupplier)
95
+
StoreBuilder storeBuilder,
96
+
String sourceName,
97
+
Deserializer keyDeserializer,
98
+
Deserializer valueDeserializer,
99
+
String topic,
100
+
String processorName,
101
+
ProcessorSupplier stateUpdateSupplier)
108
102
Topology addGlobalStore(
109
-
final StoreBuilder storeBuilder,
110
-
final String sourceName,
111
-
final TimestampExtractor timestampExtractor,
112
-
final Deserializer keyDeserializer,
113
-
final Deserializer valueDeserializer,
114
-
final String topic,
115
-
final String processorName,
116
-
final ProcessorSupplier stateUpdateSupplier)
103
+
StoreBuilder storeBuilder,
104
+
String sourceName,
105
+
TimestampExtractor timestampExtractor,
106
+
Deserializer keyDeserializer,
107
+
Deserializer valueDeserializer,
108
+
String topic,
109
+
String processorName,
110
+
ProcessorSupplier stateUpdateSupplier)
117
111
----
118
112
119
113
Adds a global <<kafka-streams-StateStore.adoc#, StateStore>> (with the <<kafka-streams-StoreBuilder.adoc#, StoreBuilder>>, <<kafka-streams-ProcessorSupplier.adoc#, ProcessorSupplier>> and optional <<kafka-streams-TimestampExtractor.adoc#, TimestampExtractor>>) to the topology.
120
114
115
+
Internally, `addGlobalStore` simply requests the <<internalTopologyBuilder, InternalTopologyBuilder>> to <<kafka-streams-internals-InternalTopologyBuilder.adoc#addGlobalStore, add a global store>>.
116
+
121
117
| addProcessor
122
118
a| [[addProcessor]]
123
119
124
120
[source, java]
125
121
----
126
122
Topology addProcessor(
127
-
final String name,
128
-
final ProcessorSupplier supplier,
129
-
final String... parentNames)
123
+
String name,
124
+
ProcessorSupplier supplier,
125
+
String... parentNames)
130
126
----
131
127
132
128
Adds a new <<kafka-streams-Processor.adoc#, processor node>> (with the <<kafka-streams-ProcessorSupplier.adoc#, ProcessorSupplier>>) to the topology
133
129
130
+
Internally, `addProcessor` simply requests the <<internalTopologyBuilder, InternalTopologyBuilder>> to <<kafka-streams-internals-InternalTopologyBuilder.adoc#addProcessor, add a processor>>.
131
+
134
132
| addSink
135
133
a| [[addSink]]
136
134
137
135
[source, java]
138
136
----
139
137
Topology addSink(
140
-
final String name,
141
-
final String topic,
142
-
final Serializer<K> keySerializer,
143
-
final Serializer<V> valueSerializer,
144
-
final StreamPartitioner<? super K, ? super V> partitioner,
145
-
final String... parentNames)
138
+
String name,
139
+
String topic,
140
+
Serializer<K> keySerializer,
141
+
Serializer<V> valueSerializer,
142
+
StreamPartitioner<? super K, ? super V> partitioner,
143
+
String... parentNames)
146
144
Topology addSink(
147
-
final String name,
148
-
final String topic,
149
-
final Serializer<K> keySerializer,
150
-
final Serializer<V> valueSerializer,
151
-
final String... parentNames)
145
+
String name,
146
+
String topic,
147
+
Serializer<K> keySerializer,
148
+
Serializer<V> valueSerializer,
149
+
String... parentNames)
152
150
Topology addSink(
153
-
final String name,
154
-
final String topic,
155
-
final StreamPartitioner<? super K, ? super V> partitioner,
156
-
final String... parentNames)
151
+
String name,
152
+
String topic,
153
+
StreamPartitioner<? super K, ? super V> partitioner,
154
+
String... parentNames)
157
155
Topology addSink(
158
-
final String name,
159
-
final String topic,
160
-
final String... parentNames)
156
+
String name,
157
+
String topic,
158
+
String... parentNames)
161
159
Topology addSink(
162
-
final String name,
163
-
final TopicNameExtractor<K, V> topicExtractor,
164
-
final Serializer<K> keySerializer,
165
-
final Serializer<V> valueSerializer,
166
-
final StreamPartitioner<? super K, ? super V> partitioner,
167
-
final String... parentNames)
160
+
String name,
161
+
TopicNameExtractor<K, V> topicExtractor,
162
+
Serializer<K> keySerializer,
163
+
Serializer<V> valueSerializer,
164
+
StreamPartitioner<? super K, ? super V> partitioner,
165
+
String... parentNames)
168
166
Topology addSink(
169
-
final String name,
170
-
final TopicNameExtractor<K, V> topicExtractor,
171
-
final Serializer<K> keySerializer,
172
-
final Serializer<V> valueSerializer,
173
-
final String... parentNames)
167
+
String name,
168
+
TopicNameExtractor<K, V> topicExtractor,
169
+
Serializer<K> keySerializer,
170
+
Serializer<V> valueSerializer,
171
+
String... parentNames)
174
172
Topology addSink(
175
-
final String name,
176
-
final TopicNameExtractor<K, V> topicExtractor,
177
-
final StreamPartitioner<? super K, ? super V> partitioner,
178
-
final String... parentNames)
173
+
String name,
174
+
TopicNameExtractor<K, V> topicExtractor,
175
+
StreamPartitioner<? super K, ? super V> partitioner,
176
+
String... parentNames)
179
177
Topology addSink(
180
-
final String name,
181
-
final TopicNameExtractor<K, V> topicExtractor,
182
-
final String... parentNames)
178
+
String name,
179
+
TopicNameExtractor<K, V> topicExtractor,
180
+
String... parentNames)
183
181
----
184
182
185
183
Adds a new <<kafka-streams-internals-SinkNode.adoc#, sink node>> (with the optional <<kafka-streams-TopicNameExtractor.adoc#, TopicNameExtractor>> and <<kafka-streams-StreamPartitioner.adoc#, StreamPartitioner>>) to the topology.
186
184
185
+
Internally, `addSink` simply requests the <<internalTopologyBuilder, InternalTopologyBuilder>> to <<kafka-streams-internals-InternalTopologyBuilder.adoc#addSink, add a sink>>.
186
+
187
187
| addSource
188
188
a| [[addSource]]
189
189
190
190
[source, java]
191
191
----
192
192
Topology addSource(
193
-
final AutoOffsetReset offsetReset,
194
-
final String name,
195
-
final Deserializer keyDeserializer,
196
-
final Deserializer valueDeserializer,
197
-
final Pattern topicPattern)
193
+
AutoOffsetReset offsetReset,
194
+
String name,
195
+
Deserializer keyDeserializer,
196
+
Deserializer valueDeserializer,
197
+
Pattern topicPattern)
198
198
Topology addSource(
199
-
final AutoOffsetReset offsetReset,
200
-
final String name,
201
-
final Deserializer keyDeserializer,
202
-
final Deserializer valueDeserializer,
203
-
final String... topics)
199
+
AutoOffsetReset offsetReset,
200
+
String name,
201
+
Deserializer keyDeserializer,
202
+
Deserializer valueDeserializer,
203
+
String... topics)
204
204
Topology addSource(
205
-
final AutoOffsetReset offsetReset,
206
-
final String name,
207
-
final Pattern topicPattern)
205
+
AutoOffsetReset offsetReset,
206
+
String name,
207
+
Pattern topicPattern)
208
208
Topology addSource(
209
-
final AutoOffsetReset offsetReset,
210
-
final String name,
211
-
final String... topics)
209
+
AutoOffsetReset offsetReset,
210
+
String name,
211
+
String... topics)
212
212
Topology addSource(
213
-
final AutoOffsetReset offsetReset,
214
-
final String name,
215
-
final TimestampExtractor timestampExtractor,
216
-
final Deserializer keyDeserializer,
217
-
final Deserializer valueDeserializer,
218
-
final Pattern topicPattern)
213
+
AutoOffsetReset offsetReset,
214
+
String name,
215
+
TimestampExtractor timestampExtractor,
216
+
Deserializer keyDeserializer,
217
+
Deserializer valueDeserializer,
218
+
Pattern topicPattern)
219
219
Topology addSource(
220
-
final AutoOffsetReset offsetReset,
221
-
final String name,
222
-
final TimestampExtractor timestampExtractor,
223
-
final Deserializer keyDeserializer,
224
-
final Deserializer valueDeserializer,
225
-
final String... topics)
220
+
AutoOffsetReset offsetReset,
221
+
String name,
222
+
TimestampExtractor timestampExtractor,
223
+
Deserializer keyDeserializer,
224
+
Deserializer valueDeserializer,
225
+
String... topics)
226
226
Topology addSource(
227
-
final AutoOffsetReset offsetReset,
228
-
final TimestampExtractor timestampExtractor,
229
-
final String name,
230
-
final Pattern topicPattern)
227
+
AutoOffsetReset offsetReset,
228
+
TimestampExtractor timestampExtractor,
229
+
String name,
230
+
Pattern topicPattern)
231
231
Topology addSource(
232
-
final AutoOffsetReset offsetReset,
233
-
final TimestampExtractor timestampExtractor,
234
-
final String name,
235
-
final String... topics)
232
+
AutoOffsetReset offsetReset,
233
+
TimestampExtractor timestampExtractor,
234
+
String name,
235
+
String... topics)
236
236
Topology addSource(
237
-
final String name,
238
-
final Deserializer keyDeserializer,
239
-
final Deserializer valueDeserializer,
240
-
final Pattern topicPattern)
237
+
String name,
238
+
Deserializer keyDeserializer,
239
+
Deserializer valueDeserializer,
240
+
Pattern topicPattern)
241
241
Topology addSource(
242
-
final String name,
243
-
final Deserializer keyDeserializer,
244
-
final Deserializer valueDeserializer,
245
-
final String... topics)
242
+
String name,
243
+
Deserializer keyDeserializer,
244
+
Deserializer valueDeserializer,
245
+
String... topics)
246
246
Topology addSource(
247
-
final String name,
248
-
final Pattern topicPattern)
247
+
String name,
248
+
Pattern topicPattern)
249
249
Topology addSource(
250
-
final String name,
251
-
final String... topics)
250
+
String name,
251
+
String... topics)
252
252
Topology addSource(
253
-
final TimestampExtractor timestampExtractor,
254
-
final String name,
255
-
final Pattern topicPattern)
253
+
TimestampExtractor timestampExtractor,
254
+
String name,
255
+
Pattern topicPattern)
256
256
Topology addSource(
257
-
final TimestampExtractor timestampExtractor,
258
-
final String name,
259
-
final String... topics)
257
+
TimestampExtractor timestampExtractor,
258
+
String name,
259
+
String... topics)
260
260
----
261
261
262
262
Adds a new <<kafka-streams-internals-SourceNode.adoc#, source node>> (with the optional <<AutoOffsetReset, AutoOffsetReset>> and <<kafka-streams-TimestampExtractor.adoc#, TimestampExtractor>>) to the topology.
263
263
264
+
Internally, `addSource` simply requests the <<internalTopologyBuilder, InternalTopologyBuilder>> to <<kafka-streams-internals-InternalTopologyBuilder.adoc#addSource, add a source>>.
265
+
264
266
| addStateStore
265
267
a| [[addStateStore]]
266
268
@@ -273,20 +275,22 @@ Topology addStateStore(
273
275
274
276
Adds a new <<kafka-streams-StateStore.adoc#, state store>> (as a <<kafka-streams-StoreBuilder.adoc#, StoreBuilder>>) to the topology and associates it with processors
275
277
276
-
Internally, `addStateStore` simply requests the <<internalTopologyBuilder, InternalTopologyBuilder>> to <<kafka-streams-internals-InternalTopologyBuilder.adoc#addStateStore, add a state store (as a StoreBuilder)>>
278
+
Internally, `addStateStore` simply requests the <<internalTopologyBuilder, InternalTopologyBuilder>> to <<kafka-streams-internals-InternalTopologyBuilder.adoc#addStateStore, add a state store>>.
277
279
278
280
| connectProcessorAndStateStores
279
281
a| [[connectProcessorAndStateStores]]
280
282
281
283
[source, java]
282
284
----
283
285
Topology connectProcessorAndStateStores(
284
-
final String processorName,
285
-
final String... stateStoreNames)
286
+
String processorName,
287
+
String... stateStoreNames)
286
288
----
287
289
288
290
Connects the <<kafka-streams-internals-ProcessorNode.adoc#, processor node>> with <<kafka-streams-StateStore.adoc#, state stores>> (by name).
289
291
292
+
Internally, `connectProcessorAndStateStores` simply requests the <<internalTopologyBuilder, InternalTopologyBuilder>> to <<kafka-streams-internals-InternalTopologyBuilder.adoc#connectProcessorAndStateStores, connect a processor with state stores>>.
293
+
290
294
| describe
291
295
a| [[describe]]
292
296
@@ -295,12 +299,20 @@ a| [[describe]]
295
299
TopologyDescription describe()
296
300
----
297
301
298
-
<<kafka-streams-TopologyDescription.adoc#, Meta representation>> of the topology
302
+
Describes the topology via <<kafka-streams-TopologyDescription.adoc#, TopologyDescription>> (_meta representation_)
303
+
304
+
Internally, `describe` simply requests the <<internalTopologyBuilder, InternalTopologyBuilder>> to <<kafka-streams-internals-InternalTopologyBuilder.adoc#describe, describe a topology>>.
299
305
300
306
|===
301
307
302
308
[[internalTopologyBuilder]]
303
-
Internally, `Topology` uses an <<kafka-streams-internals-InternalTopologyBuilder.adoc#, InternalTopologyBuilder>> in all <<operators, methods>> (and is therefore a thin layer atop).
309
+
Internally, `Topology` uses an <<kafka-streams-internals-InternalTopologyBuilder.adoc#, InternalTopologyBuilder>> for all the <<operators, methods>> and is simply a thin layer atop (that aims at making Kafka Streams developers' life simpler).
Copy file name to clipboardexpand all lines: kafka-streams-internals-InternalTopologyBuilder.adoc
+104-83
Original file line number
Diff line number
Diff line change
@@ -155,7 +155,7 @@ Topologies:
155
155
| [[earliestResetTopics]]
156
156
157
157
| globalStateStores
158
-
a| [[globalStateStores]] Global link:kafka-streams-StateStore.adoc[StateStores] by name
158
+
a| [[globalStateStores]] Global <<kafka-streams-StateStore.adoc#, state stores>> by name
159
159
160
160
* A new global link:kafka-streams-StateStore.adoc[StateStore] is added exclusively when `InternalTopologyBuilder` is requested to <<addGlobalStore, add a global state store to a topology>>
NOTE: `copartitionGroups` is used exclusively when `StreamsPartitionAssignor` is requested to <<kafka-streams-internals-StreamsPartitionAssignor.adoc#assign, perform group assignment (assign tasks to consumer clients)>>.
NOTE: `copartitionSources` is used exclusively when `AbstractStream` is requested to <<kafka-streams-internals-AbstractStream.adoc#ensureJoinableWith, ensureJoinableWith>>.
=== [[addProcessor]] Adding Processor to Topology -- `addProcessor` Method
355
367
356
368
[source, java]
357
369
----
@@ -404,34 +416,34 @@ NOTE: `buildProcessorNode` is used exclusively when `InternalTopologyBuilder` is
404
416
[source, java]
405
417
----
406
418
void buildSourceNode(
407
-
final Map<String, SourceNode> topicSourceMap,
408
-
final Set<String> repartitionTopics,
409
-
final SourceNodeFactory sourceNodeFactory,
410
-
final SourceNode node)
419
+
Map<String, SourceNode> topicSourceMap,
420
+
Set<String> repartitionTopics,
421
+
SourceNodeFactory sourceNodeFactory,
422
+
SourceNode node)
411
423
----
412
424
413
425
`buildSourceNode`...FIXME
414
426
415
-
NOTE: `buildSourceNode` is used exclusively when `InternalTopologyBuilder` is requested to link:kafka-streams-internals-InternalTopologyBuilder.adoc#build[build a topology of processor tasks] (aka *processor topology*).
427
+
NOTE: `buildSourceNode` is used exclusively when `InternalTopologyBuilder` is requested to <<build, build a topology of processor nodes>>.
=== [[addSource]] Adding Source Node to Topology -- `addSource` Method
418
430
419
-
[source, scala]
431
+
[source, java]
420
432
----
421
-
final void addSource(
422
-
final Topology.AutoOffsetReset offsetReset,
423
-
final String name,
424
-
final TimestampExtractor timestampExtractor,
425
-
final Deserializer keyDeserializer,
426
-
final Deserializer valDeserializer,
427
-
final Pattern topicPattern)
428
-
final void addSource(
429
-
final Topology.AutoOffsetReset offsetReset,
430
-
final String name,
431
-
final TimestampExtractor timestampExtractor,
432
-
final Deserializer keyDeserializer,
433
-
final Deserializer valDeserializer,
434
-
final String... topics)
433
+
void addSource(
434
+
Topology.AutoOffsetReset offsetReset,
435
+
String name,
436
+
TimestampExtractor timestampExtractor,
437
+
Deserializer keyDeserializer,
438
+
Deserializer valDeserializer,
439
+
Pattern topicPattern)
440
+
void addSource(
441
+
Topology.AutoOffsetReset offsetReset,
442
+
String name,
443
+
TimestampExtractor timestampExtractor,
444
+
Deserializer keyDeserializer,
445
+
Deserializer valDeserializer,
446
+
String... topics)
435
447
----
436
448
437
449
`addSource` simply registers a new <<kafka-streams-internals-InternalTopologyBuilder-SourceNodeFactory.adoc#, SourceNodeFactory>> by the given name in the <<nodeFactories, nodeFactories>> internal registry.
NOTE: `validateTopicNotAlreadyRegistered` is used when...FIXME
496
508
497
-
=== [[connectProcessorAndStateStores]] Connecting State Store with Processor Nodes -- `connectProcessorAndStateStores` Method
509
+
=== [[connectProcessorAndStateStores]] Connecting Processor with State Stores -- `connectProcessorAndStateStores` Method
498
510
499
511
[source, java]
500
512
----
501
513
void connectProcessorAndStateStores(
502
-
final String processorName,
503
-
final String... stateStoreNames)
514
+
String processorName,
515
+
String... stateStoreNames)
504
516
----
505
517
506
518
`connectProcessorAndStateStores` simply <<connectProcessorAndStateStore, connectProcessorAndStateStore>> with `processorName` and every state store name in `stateStoreNames`.
@@ -515,26 +527,24 @@ NOTE: `connectProcessorAndStateStores` (plural) is a public method that uses the
515
527
====
516
528
`connectProcessorAndStateStores` is used when:
517
529
518
-
* `KStreamImpl` is requested to link:kafka-streams-internals-KStreamImpl.adoc#doStreamTableJoin[doStreamTableJoin], link:kafka-streams-internals-KStreamImpl.adoc#process[process], link:kafka-streams-internals-KStreamImpl.adoc#transform[transform], link:kafka-streams-internals-KStreamImpl.adoc#transformValues[transformValues]
530
+
* `Topology` is requested to <<kafka-streams-Topology.adoc#connectProcessorAndStateStores, connect a processor with state stores>>
519
531
520
-
* `KTableImpl` is requested to link:kafka-streams-internals-KTableImpl.adoc#buildJoin[buildJoin]
521
-
522
-
* `Topology` is requested to link:kafka-streams-Topology.adoc#connectProcessorAndStateStores[connectProcessorAndStateStores]
532
+
* <<kafka-streams-internals-StreamsGraphNode.adoc#, StreamsGraphNodes>> (i.e. <<kafka-streams-internals-KTableKTableJoinNode.adoc#, KTableKTableJoinNode>>, <<kafka-streams-internals-StatefulProcessorNode.adoc#, StatefulProcessorNode>>, <<kafka-streams-internals-StreamTableJoinNode.adoc#, StreamTableJoinNode>>, and <<kafka-streams-internals-TableProcessorNode.adoc#, TableProcessorNode>>) are requested to <<kafka-streams-internals-StreamsGraphNode.adoc#writeToTopology, write to a topology>>
523
533
====
524
534
525
-
=== [[addGlobalStore]] Adding Global Key-Value State Store (to Topology) -- `addGlobalStore` Method
535
+
=== [[addGlobalStore]] Adding Global State Store to Topology -- `addGlobalStore` Method
526
536
527
537
[source, java]
528
538
----
529
539
void addGlobalStore(
530
-
final StoreBuilder<KeyValueStore> storeBuilder,
531
-
final String sourceName,
532
-
final TimestampExtractor timestampExtractor,
533
-
final Deserializer keyDeserializer,
534
-
final Deserializer valueDeserializer,
535
-
final String topic,
536
-
final String processorName,
537
-
final ProcessorSupplier stateUpdateSupplier)
540
+
StoreBuilder storeBuilder,
541
+
String sourceName,
542
+
TimestampExtractor timestampExtractor,
543
+
Deserializer keyDeserializer,
544
+
Deserializer valueDeserializer,
545
+
String topic,
546
+
String processorName,
547
+
ProcessorSupplier stateUpdateSupplier)
538
548
----
539
549
540
550
`addGlobalStore` first <<validateGlobalStoreArguments, validateGlobalStoreArguments>> followed by <<validateTopicNotAlreadyRegistered, validateTopicNotAlreadyRegistered>>.
@@ -606,8 +616,8 @@ NOTE: `validateGlobalStoreArguments` is used exclusively when `InternalTopologyB
606
616
[source, java]
607
617
----
608
618
void connectSourceStoreAndTopic(
609
-
final String sourceStoreName,
610
-
final String topic)
619
+
String sourceStoreName,
620
+
String topic)
611
621
----
612
622
613
623
`connectSourceStoreAndTopic` adds the given `sourceStoreName` with the `topic` to <<storeToChangelogTopic, storeToChangelogTopic>> internal registry.
NOTE: `connectSourceStoreAndTopic` is used when `InternalTopologyBuilder` is requested to <<addGlobalStore, add a global state store to a topology>> and <<adjust, adjust>>.
631
+
[NOTE]
632
+
====
633
+
`connectSourceStoreAndTopic` is used when:
634
+
635
+
* `InternalTopologyBuilder` is requested to <<addGlobalStore, add a global state store to a topology>>
636
+
637
+
* `TableSourceNode` is requested to <<kafka-streams-internals-TableSourceNode.adoc#writeToTopology, write to a topology>>
638
+
====
622
639
623
640
=== [[connectProcessorAndStateStore]] Connecting State Store with Processor Node -- `connectProcessorAndStateStore` Internal Method
624
641
@@ -641,22 +658,22 @@ In the end, `connectProcessorAndStateStore` <<connectStateStoreNameToSourceTopic
641
658
642
659
`connectProcessorAndStateStore` reports a `TopologyException` when the input `stateStoreName` or `processorName` have not been registered yet or the `processorName` is the name of a source or sink node.
643
660
644
-
NOTE: `connectProcessorAndStateStore` is used when `InternalTopologyBuilder` is requested to <<addStateStore, addStateStore>> and <<connectProcessorAndStateStores, connectProcessorAndStateStores>>
661
+
NOTE: `connectProcessorAndStateStore` is used when `InternalTopologyBuilder` is requested to <<addStateStore, add a state store>> and <<connectProcessorAndStateStores, connect a processor with state stores>>.
NOTE: `connectStateStoreNameToSourceTopicsOrPattern` is used when...FIXME
674
+
NOTE: `connectStateStoreNameToSourceTopicsOrPattern` is used exclusively when `InternalTopologyBuilder` is requested to <<connectProcessorAndStateStore, connect a processor with a state store>>
658
675
659
-
=== [[addStateStore]] Adding State Store (As StoreBuilder) -- `addStateStore` Method
676
+
=== [[addStateStore]] Adding State Store to Topology -- `addStateStore` Method
@@ -779,7 +796,7 @@ Otherwise, `isGlobalSource` is negative (i.e. `false`).
779
796
780
797
NOTE: `isGlobalSource` is used when `InternalTopologyBuilder` is requested to <<describeGlobalStore, describeGlobalStore>>, <<globalNodeGroups, globalNodeGroups>> and <<nodeGroupContainsGlobalSourceNode, nodeGroupContainsGlobalSourceNode>>.
781
798
782
-
=== [[globalNodeGroups]] Collecting Global Node Groups -- `globalNodeGroups` Internal Method
799
+
=== [[globalNodeGroups]] Global Node Groups -- `globalNodeGroups` Internal Method
783
800
784
801
[source, java]
785
802
----
@@ -896,7 +913,7 @@ Topologies:
896
913
<-- sourceName
897
914
----
898
915
899
-
NOTE: `describe` is used exclusively when `Topology` is requested to link:kafka-streams-Topology.adoc#describe[describe].
916
+
NOTE: `describe` is used exclusively when `Topology` is requested to <<kafka-streams-Topology.adoc#describe, describe>>.
<1> Uses <<build-topicGroupId, build>> with an undefined `topicGroupId` (i.e. `null`)
995
1015
<2> Uses `build` with `nodeGroup` being the node names for a given `topicGroupId`
@@ -1018,13 +1038,14 @@ NOTE: `nodeGroup` can be either <<globalNodeGroups, global node groups>> (aka _g
1018
1038
1019
1039
NOTE: The private `build` is used when `InternalTopologyBuilder` is requested to <<build-topicGroupId, build a processor task topology>> (for a group ID) and <<buildGlobalStateTopology, build a global processor task topology>>.
1020
1040
1021
-
NOTE: The parameter-less `build` is used exclusively when `KafkaStreams` is <<kafka-streams-KafkaStreams.adoc#, created>> (as a sanity check to fail-fast in case a `ProcessorTopology` could not be built due to some exception).
1041
+
NOTE: The no-argument `build` is used exclusively when `KafkaStreams` is <<kafka-streams-KafkaStreams.adoc#, created>> (as a sanity check to fail-fast in case a `ProcessorTopology` could not be built due to some exception).
1022
1042
1023
1043
==== [[build-topicGroupId]] Building Processor Task Topology For Group ID -- `build` Factory Method
This variant of `build` takes either a group ID or `null` (see the parameter-less <<build, build()>>).
@@ -1037,7 +1058,7 @@ When the input `topicGroupId` is undefined (i.e. `null`), `build` takes the node
1037
1058
====
1038
1059
`build` (with a topic group ID) is used when:
1039
1060
1040
-
* `InternalTopologyBuilder` is requested to <<build, build a processor task topology>> (with no group ID)
1061
+
* `InternalTopologyBuilder` is requested to <<build, build a processor task topology>> (with no group ID specified)
1041
1062
1042
1063
* `StandbyTaskCreator` is requested to <<kafka-streams-internals-StandbyTaskCreator.adoc#createTask, create a standby task for a given task ID>>
1043
1064
@@ -1060,8 +1081,8 @@ NOTE: `allStateStoreName` is used exclusively when `TopologyTestDriver` is reque
1060
1081
[source, java]
1061
1082
----
1062
1083
InternalTopicConfig createChangelogTopicConfig(
1063
-
final StateStoreFactory factory,
1064
-
final String name)
1084
+
StateStoreFactory factory,
1085
+
String name)
1065
1086
----
1066
1087
1067
1088
`createChangelogTopicConfig` creates a <<kafka-streams-internals-UnwindowedChangelogTopicConfig.adoc#, UnwindowedChangelogTopicConfig>> or a <<kafka-streams-internals-WindowedChangelogTopicConfig.adoc#, WindowedChangelogTopicConfig>> per the <<kafka-streams-internals-InternalTopologyBuilder-StateStoreFactory.adoc#isWindowStore, isWindowStore>> flag of the input `StateStoreFactory`.
@@ -1107,13 +1128,13 @@ Before returning the <<topicPattern, source topics pattern>>, `sourceTopicPatter
1107
1128
[source, java]
1108
1129
----
1109
1130
Pattern buildPatternForOffsetResetTopics(
1110
-
final Collection<String> sourceTopics,
1111
-
final Collection<Pattern> sourcePatterns)
1131
+
Collection<String> sourceTopics,
1132
+
Collection<Pattern> sourcePatterns)
1112
1133
----
1113
1134
1114
1135
`buildPatternForOffsetResetTopics`...FIXME
1115
1136
1116
-
NOTE: `buildPatternForOffsetResetTopics` is used when...FIXME
1137
+
NOTE: `buildPatternForOffsetResetTopics` is used when `InternalTopologyBuilder` is requested to <<resetTopicsPattern, resetTopicsPattern>> and <<sourceTopicPattern, sourceTopicPattern>>.
0 commit comments