Skip to content
代码片段 群组 项目
未验证 提交 06f47c3b 编辑于 作者: Guozhang Wang's avatar Guozhang Wang 提交者: GitHub
浏览文件

KAFKA-10199: Further refactor task lifecycle management (#12439)

1. Consolidate the task recycle procedure into a single function within the task. The current procedure now becomes: a) task.recycleStateAndConvert, at end of it the task is in closed while its stateManager is retained, and the manager type has been converted; 2) create the new task with old task's fields and the stateManager inside the creators.
2. Move the task execution related metadata into the corresponding TaskExecutionMetadata class, including the task idle related metadata (e.g. successfully processed tasks); reduce the number of params needed for TaskExecutor as well as Tasks.
3. Move the task execution related fields (embedded producer and consumer) and task creators out of Tasks and migrated into TaskManager. Now the Tasks is only a bookkeeping place without any task mutation logic.
4. When adding tests, I realized that we should not add task to state updater right after creation, since it was not initialized yet, while state updater would validate that the task's state is already restoring / running. So I updated that logic while adding unit tests.

Reviewers: Bruno Cadonna <cadonna@apache.org>
上级 d076b7ad
No related branches found
No related tags found
无相关合并请求
显示
512 个添加553 个删除
加载中
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册