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
Copy file name to clipboardexpand all lines: kafka-streams-Processor.adoc
+4-4
Original file line number
Diff line number
Diff line change
@@ -35,9 +35,9 @@ a| [[init]]
35
35
void init(ProcessorContext context)
36
36
----
37
37
38
-
Initializes the processor (with a <<kafka-streams-ProcessorContext.adoc#, ProcessorContext>>)
38
+
Initializes the processor with a <<kafka-streams-ProcessorContext.adoc#, ProcessorContext>> (that can be used to decide whether a record should be <<kafka-streams-ProcessorContext.adoc#forward, forwarded downstream>> to child processors if there are any)
39
39
40
-
Used exclusively when `ProcessorNode` is requested to <<kafka-streams-internals-ProcessorNode.adoc#init, init>>.
40
+
Used exclusively when `ProcessorNode` is requested to <<kafka-streams-internals-ProcessorNode.adoc#init, init>>
41
41
42
42
| process
43
43
a| [[process]]
@@ -47,9 +47,9 @@ a| [[process]]
47
47
void process(K key, V value)
48
48
----
49
49
50
-
Processes a single record
50
+
Processes a single record (as a pair of a `K` key and a `V` value)
51
51
52
-
Used exclusively when `ProcessorNode` is requested to <<kafka-streams-internals-ProcessorNode.adoc#process, process>>.
52
+
Used exclusively when `ProcessorNode` is requested to <<kafka-streams-internals-ProcessorNode.adoc#process, process a single record (as a key and value pair)>>.
Copy file name to clipboardexpand all lines: kafka-streams-internals-PartitionGroup.adoc
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
== [[PartitionGroup]] PartitionGroup
2
2
3
-
`PartitionGroup`manages <<partitionQueues, RecordQueuesper partition>> assigned to a <<kafka-streams-internals-StreamTask.adoc#, StreamTask>>.
3
+
`PartitionGroup`is a collection of <<partitionQueues, RecordQueues>> (one per every <<kafka-streams-internals-StreamTask.adoc#partitions, partition>> assigned to a <<kafka-streams-internals-StreamTask.adoc#, StreamTask>>).
4
4
5
5
`PartitionGroup` is <<creating-instance, created>> exclusively for a <<kafka-streams-internals-StreamTask.adoc#partitionGroup, StreamTask>>.
Copy file name to clipboardexpand all lines: kafka-streams-internals-ProcessorNode.adoc
+32-30
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
== [[ProcessorNode]] ProcessorNode
2
2
3
-
`ProcessorNode` is a <<process, processing node>> in a topology that is identified by a <<name, name>> and have zero or more <<children, child processor nodes>>.
3
+
`ProcessorNode` is a <<process, processing node>> in a processor topology that is identified by a <<name, name>> and have zero or more <<children, child processor nodes>>.
4
4
5
5
NOTE: link:kafka-streams-internals-SourceNode.adoc[SourceNode] and link:kafka-streams-internals-SinkNode.adoc[SinkNode] are specialized `ProcessorNodes`.
6
6
@@ -12,29 +12,6 @@ NOTE: link:kafka-streams-internals-SourceNode.adoc[SourceNode] and link:kafka-st
12
12
13
13
`ProcessorNode` has a <<toString, human-friendly / textual representation>> that is particularly helpful for debugging.
14
14
15
-
[[internal-registries]]
16
-
.ProcessorNode's Internal Properties (e.g. Registries, Counters and Flags)
* `StreamTask` is requested to <<kafka-streams-internals-StreamTask.adoc#initTopology, initTopology>>
54
31
====
55
32
56
-
=== [[process]] Processing Record -- `process` Method
33
+
=== [[process]] Processing Single Record (As Key and Value Pair) -- `process` Method
57
34
58
35
[source, java]
59
36
----
60
37
void process(final K key, final V value)
61
38
----
62
39
63
-
`process`...FIXME
40
+
`process` requests the <<processor, Processor>> to <<kafka-streams-Processor.adoc#process, process the given key and value pair>>.
41
+
42
+
In the end, `process` requests the <<nodeMetrics, NodeMetrics>> for the <<kafka-streams-NodeMetrics.adoc#nodeProcessTimeSensor, nodeProcessTimeSensor>> to record the processing time.
64
43
65
44
[NOTE]
66
45
====
@@ -70,18 +49,18 @@ void process(final K key, final V value)
70
49
71
50
* `GlobalStateUpdateTask` is requested to <<kafka-streams-internals-GlobalStateUpdateTask.adoc#update, update>>
72
51
73
-
* `StreamTask` is requested to <<kafka-streams-internals-StreamTask.adoc#process, process>>
52
+
* `StreamTask` is requested to <<kafka-streams-internals-StreamTask.adoc#process, process a single record>>
@@ -130,3 +109,26 @@ void punctuate(final long timestamp, final Punctuator punctuator)
130
109
`punctuate` requests the <<nodeMetrics, NodeMetrics>> for the link:kafka-streams-NodeMetrics.adoc#metrics[StreamsMetricsImpl] that is requested to link:kafka-streams-internals-StreamsMetricsImpl.adoc#measureLatencyNs[measureLatencyNs] (that records it with the link:kafka-streams-NodeMetrics.adoc#nodePunctuateTimeSensor[nodePunctuateTimeSensor] of the <<nodeMetrics, NodeMetrics>>).
131
110
132
111
NOTE: `punctuate` is used exclusively when `StreamTask` is requested to link:kafka-streams-internals-StreamTask.adoc#punctuate[execute a scheduled periodic action].
Copy file name to clipboardexpand all lines: kafka-streams-internals-StreamTask.adoc
+12-7
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,10 @@
1
1
== [[StreamTask]] StreamTask
2
2
3
-
`StreamTask` is a concrete <<kafka-streams-internals-AbstractTask.adoc#, stream processor task>> that uses a <<partitionGroup, PartitionGroup>> (with the <<partitions, partitions assigned>>) to <<process, process records>> (one at a time) ordered by partition timestamp.
3
+
`StreamTask` is a concrete <<kafka-streams-internals-AbstractTask.adoc#, stream processor task>> that uses a <<partitionGroup, PartitionGroup>> (with the <<partitions, partitions assigned>>) to determine which record should be <<process, processed>> (as ordered by partition timestamp).
4
+
5
+
When requested to <<process, process a single record>>, `StreamTask` requests the <<partitionGroup, PartitionGroup>> for the <<kafka-streams-internals-PartitionGroup.adoc#nextRecord, next stamped record (record with timestamp) and the RecordQueue>>. `StreamTask` uses a <<recordInfo, RecordInfo>> to hold the <<kafka-streams-internals-RecordQueue.adoc#, RecordQueue>> (with the source <<kafka-streams-internals-ProcessorNode.adoc#, processor node>> and the partition) of the currently-processed stamped record. Eventually, `StreamTask` requests the source processor node (of the `RecordQueue` and the partition) to <<kafka-streams-internals-ProcessorNode.adoc#process, process the record>>.
6
+
7
+
NOTE: It is at the discretion of a processor node (incl. a source processor node) to <<kafka-streams-ProcessorContext.adoc#forward, forward the record downstream>> (to child processors if there are any).
4
8
5
9
`StreamTask` is <<creating-instance, created>> exclusively when `TaskCreator` is requested to <<kafka-streams-internals-TaskCreator.adoc#createTask, create one>>.
6
10
@@ -100,7 +104,7 @@ NOTE: `close` is part of link:kafka-streams-internals-Task.adoc#close[Task Contr
a| [[recordInfo]] <<kafka-streams-internals-RecordInfo.adoc#, RecordInfo>> (that holds a <<kafka-streams-internals-RecordQueue.adoc#, RecordQueue>> with the source <<kafka-streams-internals-ProcessorNode.adoc#, processor node>> and the partition the <<process, currently-processed stamped record>> came from)
550
+
551
+
Created empty alongside the <<StreamTask, StreamTask>> and _"fill up"_ with the <<kafka-streams-internals-RecordQueue.adoc#, RecordQueue>> when requested to <<process, process a single record>>
0 commit comments