klion26 commented on a change in pull request #8622: 
[FLINK-12438][doc-zh]Translate Task Lifecycle document into Chinese
URL: https://github.com/apache/flink/pull/8622#discussion_r297044835
 
 

 ##########
 File path: docs/internals/task_lifecycle.zh.md
 ##########
 @@ -23,172 +23,97 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-A task in Flink is the basic unit of execution. It is the place where each 
parallel instance of an operator is executed
-As an example, an operator with a parallelism of *5* will have each of its 
instances executed by a separate task. 
+Task 是 Flink 的基本执行单元。算子的每个并行实例都是在 task 里执行的。举个例子,一个并行度为 5 的算子,它的每个实例都由一个单独的 
task 来执行。
 
-The `StreamTask` is the base for all different task sub-types in Flink's 
streaming engine. This document goes through 
-the different phases in the lifecycle of the `StreamTask` and describes the 
main methods representing each of these 
-phases.
+在 Flink 流式计算引擎里,`StreamTask` 是所有不同子类型 task 的基础。这篇文档会深入 `StreamTask` 
生命周期的不同阶段,介绍每个阶段的主要方法。
 
 * This will be replaced by the TOC
 {:toc}
 
-## Operator Lifecycle in a nutshell
+## 算子生命周期简介
 
-Because the task is the entity that executes a parallel instance of an 
operator, its lifecycle is tightly integrated 
-with that of an operator. So, we will briefly mention the basic methods 
representing the lifecycle of an operator before 
-diving into those of the `StreamTask` itself. The list is presented below in 
the order that each of the methods is called. 
-Given that an operator can have a user-defined function (*UDF*), below each of 
the operator methods we also present 
-(indented) the methods in the lifecycle of the UDF that it calls. These 
methods are available if your operator extends 
-the `AbstractUdfStreamOperator`, which is the basic class for all operators 
that execute UDFs.
+因为 task 是算子并行实例的执行实体,所以它的生命周期跟算子的生命周期紧紧联系到一起。因此,在深入介绍 `StreamTask` 
生命周期之前,先简要介绍一下代表算子生命周期的各个基本方法。这些方法列表按调用的先后顺序排列如下所示。考虑到算子可能有用户自定义函数(*UDF*),我们也提到了
 UDF 生命周期里调用的各个方法。如果你的算子继承了 `AbstractUdfStreamOperator` 
的话,这些方法都是可用的,`AbstractUdfStreamOperator` 是所有继承 UDF 算子的基类。
 
-        // initialization phase
+        // 初始化阶段
         OPERATOR::setup
-            UDF::setRuntimeContext
+             UDF::setRuntimeContext
         OPERATOR::initializeState
         OPERATOR::open
-            UDF::open
+             UDF::open
         
-        // processing phase (called on every element/watermark)
+        // 调用处理阶段(通过每条数据或 watermark 来调用)
         OPERATOR::processElement
-            UDF::run
+             UDF::run
         OPERATOR::processWatermark
         
-        // checkpointing phase (called asynchronously on every checkpoint)
+        // checkpointing 阶段(通过每个 checkpoint 异步调用)
 
 Review comment:
   ```suggestion
           // checkpointing 阶段(每次 checkpoint 时异步调用)
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to