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-AssignedStandbyTasks.adoc
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
== [[AssignedStandbyTasks]] AssignedStandbyTasks -- AssignedTasks For StandbyTasks
2
2
3
-
`AssignedStandbyTasks` is a link:kafka-streams-AssignedTasks.adoc[AssignedTasks] for link:kafka-streams-internals-StandbyTask.adoc[StandbyTasks] that...FIXME
3
+
`AssignedStandbyTasks` is a link:kafka-streams-internals-AssignedTasks.adoc[AssignedTasks] for link:kafka-streams-internals-StandbyTask.adoc[StandbyTasks] that...FIXME
4
4
5
5
`AssignedStandbyTasks` is <<creating-instance, created>> along with a link:kafka-streams-StreamThread.adoc#create[StreamThread] (when `KafkaStreams` is link:kafka-streams-KafkaStreams.adoc#creating-instance[created]).
6
6
7
7
[[logContext]]
8
8
[[creating-instance]]
9
9
`AssignedStandbyTasks` takes a `LogContext` when created.
10
10
11
-
`AssignedStandbyTasks` uses *standby task* for link:kafka-streams-AssignedTasks.adoc#taskTypeName[taskTypeName].
11
+
`AssignedStandbyTasks` uses *standby task* for link:kafka-streams-internals-AssignedTasks.adoc#taskTypeName[taskTypeName].
Copy file name to clipboardexpand all lines: kafka-streams-AssignedStreamsTasks.adoc
+7-7
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
== [[AssignedStreamsTasks]] AssignedStreamsTasks -- AssignedTasks For StreamTasks
2
2
3
-
`AssignedStreamsTasks` is a concrete <<kafka-streams-AssignedTasks.adoc#, AssignedTasks>> of <<kafka-streams-internals-StreamTask.adoc#, StreamTasks>> that...FIXME
3
+
`AssignedStreamsTasks` is a concrete <<kafka-streams-internals-AssignedTasks.adoc#, AssignedTasks>> of <<kafka-streams-internals-StreamTask.adoc#, StreamTasks>> that...FIXME
4
4
5
5
`AssignedStreamsTasks` is <<creating-instance, created>> for a <<kafka-streams-StreamThread.adoc#create, StreamThread>> (when `KafkaStreams` is <<kafka-streams-KafkaStreams.adoc#creating-instance, created>>).
6
6
7
7
`AssignedStreamsTasks` is a `RestoringTasks` that...FIXME
8
8
9
-
It _appears_ that `AssignedStreamsTasks` simply operates on the running tasks (i.e. the tasks that are in link:kafka-streams-AssignedTasks.adoc#running[running] internal registry). When requested to <<process, process>> or <<punctuate, punctuate>> `AssignedStreamsTasks` simply walks over the `running` internal registry and triggers execution of every task.
9
+
It _appears_ that `AssignedStreamsTasks` simply operates on the running tasks (i.e. the tasks that are in link:kafka-streams-internals-AssignedTasks.adoc#running[running] internal registry). When requested to <<process, process>> or <<punctuate, punctuate>> `AssignedStreamsTasks` simply walks over the `running` internal registry and triggers execution of every task.
10
10
11
11
[[maybeCommitAction]]
12
12
`AssignedStreamsTasks` uses the *maybeCommit* task action (`TaskAction<StreamTask>`) that is used in <<maybeCommit, maybeCommit>>. The task action takes a <<kafka-streams-internals-StreamTask.adoc#, stream task>> and checks if the task link:kafka-streams-internals-StreamTask.adoc#commitNeeded[needs a commit]. If so, the action does the following:
@@ -25,7 +25,7 @@ Committed active task [id] per user request in
25
25
[[creating-instance]]
26
26
`AssignedStreamsTasks` takes a `LogContext` when created.
27
27
28
-
`AssignedStreamsTasks` uses *stream task* for link:kafka-streams-AssignedTasks.adoc#taskTypeName[taskTypeName].
28
+
`AssignedStreamsTasks` uses *stream task* for link:kafka-streams-internals-AssignedTasks.adoc#taskTypeName[taskTypeName].
29
29
30
30
[[internal-registries]]
31
31
.AssignedStreamsTasks's Internal Properties (e.g. Registries, Counters and Flags)
@@ -62,7 +62,7 @@ Refer to link:kafka-logging.adoc#log4j.properties[Application Logging Using log4
62
62
int process()
63
63
----
64
64
65
-
`process` requests every link:kafka-streams-AssignedTasks.adoc#running[running] stream task to link:kafka-streams-internals-StreamTask.adoc#process[process a single record].
65
+
`process` requests every link:kafka-streams-internals-AssignedTasks.adoc#running[running] stream task to link:kafka-streams-internals-StreamTask.adoc#process[process a single record].
66
66
67
67
In the end, `process` gives the number of stream tasks that processed a single record successfully.
68
68
@@ -76,9 +76,9 @@ In case of a `TaskMigratedException`, `process` prints out the following INFO me
76
76
Failed to process stream task [id] since it got migrated to another thread already. Closing it as zombie before triggering a new rebalance.
77
77
```
78
78
79
-
`process` then link:kafka-streams-AssignedTasks.adoc#closeZombieTask[closes the task] (considering the task a zombie). If this reports a `RuntimeException`, `process` re-throws it.
79
+
`process` then link:kafka-streams-internals-AssignedTasks.adoc#closeZombieTask[closes the task] (considering the task a zombie). If this reports a `RuntimeException`, `process` re-throws it.
80
80
81
-
`process` removes the task from link:kafka-streams-AssignedTasks.adoc#running[running] and throws the `TaskMigratedException`.
81
+
`process` removes the task from link:kafka-streams-internals-AssignedTasks.adoc#running[running] and throws the `TaskMigratedException`.
82
82
83
83
==== [[process-RuntimeException]] process and RuntimeException
84
84
@@ -97,7 +97,7 @@ Failed to process stream task [id] due to the following error:
97
97
int maybeCommit()
98
98
----
99
99
100
-
`maybeCommit` resets the <<committed, committed>> internal counter (to `0`) and <<kafka-streams-AssignedTasks.adoc#applyToRunningTasks, executes>> the <<maybeCommitAction, maybeCommitAction>> task action to every <<kafka-streams-AssignedTasks.adoc#running, running task>> (that modifies <<committed, committed>>).
100
+
`maybeCommit` resets the <<committed, committed>> internal counter (to `0`) and <<kafka-streams-internals-AssignedTasks.adoc#applyToRunningTasks, executes>> the <<maybeCommitAction, maybeCommitAction>> task action to every <<kafka-streams-internals-AssignedTasks.adoc#running, running task>> (that modifies <<committed, committed>>).
101
101
102
102
In the end, `maybeCommit` gives the number of running stream tasks that <<kafka-streams-internals-StreamTask.adoc#commitNeeded, needed a commit>>.
`Processor` is the <<contract, contract>> for *record stream processors* (aka _stream processing nodes_) that <<process, process records>> (one at a time).
3
+
`Processor` is the main <<contract, abstraction>> of the <<kafka-streams-processor-api.adoc#, Low-Level Processor API>> for *record stream processors* (aka _stream processing nodes_) that can <<process, process one record at a time>>.
4
4
5
-
`Processor` is an integral part of link:kafka-streams-internals-ProcessorNode.adoc#processor[ProcessorNode].
5
+
`Processor` can be added to a <<kafka-streams-Topology.adoc#, Topology>> using <<kafka-streams-Topology.adoc#addProcessor, Topology.addProcessor>> operator (via <<kafka-streams-ProcessorSupplier.adoc#, ProcessorSupplier>>).
6
+
7
+
NOTE: <<kafka-streams-streams-dsl.adoc#, Streams DSL -- High-Level Stream Processing DSL>> comes with the <<kafka-streams-KStream.adoc#process, KStream.process>> operator to add a custom `Processor` to a topology (via <<kafka-streams-ProcessorSupplier.adoc#, ProcessorSupplier>>).
8
+
9
+
The lifecycle of a `Processor` is fully controlled by a corresponding <<kafka-streams-internals-ProcessorNode.adoc#processor, ProcessorNode>>.
6
10
7
11
[[contract]]
8
12
.Processor Contract
@@ -21,6 +25,8 @@ void close()
21
25
22
26
Closes the processor
23
27
28
+
Used exclusively when `ProcessorNode` is requested to <<kafka-streams-internals-ProcessorNode.adoc#close, close>>.
| [[AbstractProcessor]] Abstract Processor that manages the `ProcessorContext` instance and provides a no-op <<close, close>> implementation
66
+
| [[AbstractProcessor]] Abstract processor that manages a <<kafka-streams-ProcessorContext.adoc#, ProcessorContext>> instance and provides a no-op <<close, close>> implementation
NOTE: `suspendTasks` is used exclusively when `AssignedTasks` is requested to <<suspend, suspend all active tasks>>.
122
122
123
123
=== [[hasRunningTasks]] Checking If There Is At Least One Running Task -- `hasRunningTasks` Method
124
124
@@ -385,7 +385,7 @@ Close created [taskTypeName] [created]
385
385
386
386
In the end, `suspend` removes all entries from <<running, running>>, <<restoring, restoring>>, <<created, created>>, <<runningByPartition, runningByPartition>> and <<restoringByPartition, restoringByPartition>>.
387
387
388
-
NOTE: `suspend` is used exclusively when `TaskManager` is requested to link:kafka-streams-internals-TaskManager.adoc#suspendTasksAndState[suspend all active and standby stream tasks and state].
388
+
NOTE: `suspend` is used exclusively when `TaskManager` is requested to <<kafka-streams-internals-TaskManager.adoc#suspendTasksAndState, suspend all active and standby stream tasks and state>>.
NOTE: `getStateStore` is part of the <<kafka-streams-ProcessorContext.adoc#getStateStore, ProcessorContext Contract>> to...FIXME.
13
13
14
14
`getStateStore` simply requests the <<kafka-streams-AbstractProcessorContext.adoc#stateManager, StateManager>> to <<kafka-streams-internals-StateManager.adoc#getGlobalStore, get the global state store>> by the given name.
15
+
16
+
=== [[forward]] `forward` Method
17
+
18
+
[source, java]
19
+
----
20
+
void forward(final K key, final V value)
21
+
----
22
+
23
+
NOTE: `forward` is part of the <<kafka-streams-ProcessorContext.adoc#forward, ProcessorContext Contract>> to...FIXME.
* `GlobalStateUpdateTask` is requested to <<kafka-streams-internals-GlobalStateUpdateTask.adoc#initTopology, initTopology>>
52
+
53
+
* `StreamTask` is requested to <<kafka-streams-internals-StreamTask.adoc#initTopology, initTopology>>
54
+
====
55
+
56
+
=== [[process]] Processing Record -- `process` Method
50
57
51
58
[source, java]
52
59
----
@@ -55,7 +62,16 @@ void process(final K key, final V value)
55
62
56
63
`process`...FIXME
57
64
58
-
NOTE: `process` is used when...FIXME
65
+
[NOTE]
66
+
====
67
+
`process` is used when:
68
+
69
+
* <<kafka-streams-internals-GlobalProcessorContextImpl.adoc#forward, GlobalProcessorContextImpl>> and <<kafka-streams-ProcessorContextImpl.adoc#forward, ProcessorContextImpl>> are requested to forward
70
+
71
+
* `GlobalStateUpdateTask` is requested to <<kafka-streams-internals-GlobalStateUpdateTask.adoc#update, update>>
72
+
73
+
* `StreamTask` is requested to <<kafka-streams-internals-StreamTask.adoc#process, process>>
NOTE: `close` is used exclusively when `StreamTask` is requested to <<kafka-streams-internals-StreamTask.adoc#closeTopology, closeTopology>> (when `StreamTask` is requested to <<kafka-streams-internals-StreamTask.adoc#suspend, suspend>>).
Copy file name to clipboardexpand all lines: kafka-streams-internals-Task.adoc
+13-11
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ Changelog partitions associated with the task
66
66
67
67
Used when:
68
68
69
-
* `AssignedTasks` is requested to <<kafka-streams-AssignedTasks.adoc#updateRestored, updateRestored>>, <<kafka-streams-AssignedTasks.adoc#addToRestoring, addToRestoring>> and <<kafka-streams-AssignedTasks.adoc#transitionToRunning, transitionToRunning>>
69
+
* `AssignedTasks` is requested to <<kafka-streams-internals-AssignedTasks.adoc#updateRestored, updateRestored>>, <<kafka-streams-internals-AssignedTasks.adoc#addToRestoring, addToRestoring>> and <<kafka-streams-internals-AssignedTasks.adoc#transitionToRunning, transitionToRunning>>
70
70
71
71
* `StreamTask` is requested to <<kafka-streams-internals-StreamTask.adoc#initializeStateStores, initialize state stores>>.
72
72
@@ -84,15 +84,15 @@ Used when:
84
84
85
85
* `AssignedTasks` is requested to do the following:
Used exclusively when `AssignedTasks` is requested to <<kafka-streams-AssignedTasks.adoc#initializeNewTasks, initializeNewTasks>>.
186
+
Used exclusively when `AssignedTasks` is requested to <<kafka-streams-internals-AssignedTasks.adoc#initializeNewTasks, initializeNewTasks>>.
187
187
188
188
| initializeTopology
189
189
a| [[initializeTopology]]
@@ -193,7 +193,7 @@ a| [[initializeTopology]]
193
193
void initializeTopology()
194
194
----
195
195
196
-
Used exclusively when `AssignedTasks` is requested to link:kafka-streams-AssignedTasks.adoc#transitionToRunning[schedule a task for execution]
196
+
Used exclusively when `AssignedTasks` is requested to link:kafka-streams-internals-AssignedTasks.adoc#transitionToRunning[schedule a task for execution]
197
197
198
198
| partitions
199
199
a| [[partitions]]
@@ -219,6 +219,8 @@ a| [[suspend]]
219
219
void suspend()
220
220
----
221
221
222
+
Used exclusively when `AssignedTasks` is requested to <<kafka-streams-internals-AssignedTasks.adoc#suspendTasks, suspend tasks>>.
0 commit comments