klion26 commented on a change in pull request #9805: [FLINK-11635][docs-zh]
translate dev/stream/state/checkpointing into Chinese
URL: https://github.com/apache/flink/pull/9805#discussion_r334224444
##########
File path: docs/dev/stream/state/checkpointing.zh.md
##########
@@ -25,146 +25,138 @@ under the License.
* ToC
{:toc}
-Every function and operator in Flink can be **stateful** (see [working with
state](state.html) for details).
-Stateful functions store data across the processing of individual
elements/events, making state a critical building block for
-any type of more elaborate operation.
+Flink 中的每个方法或算子都能够是**有状态的**(阅读 [working with state](state.html) 查看详细)。
+状态化的方法在处理单个 元素/事件 的时候存储数据,让状态成为使各个类型的算子更加精细的重要部分。
+为了让状态容错,Flink 需要为状态添加**Checkpoint(检查点)**。Checkpoint 使得 Flink
能够恢复状态和在流中的位置,从而向应用提供和无故障执行时一样的语义。
-In order to make state fault tolerant, Flink needs to **checkpoint** the
state. Checkpoints allow Flink to recover state and positions
-in the streams to give the application the same semantics as a failure-free
execution.
+[Documentation on streaming fault tolerance]({{ site.baseurl
}}/zh/internals/stream_checkpointing.html) 介绍了 Flink 流计算容错机制内部的技术原理。
-The [documentation on streaming fault tolerance]({{ site.baseurl
}}/internals/stream_checkpointing.html) describes in detail the technique
behind Flink's streaming fault tolerance mechanism.
+## 前提条件
-## Prerequisites
+Flink 的 Checkpoint 机制会和持久化存储进行交互,交换流与状态。一般需要:
-Flink's checkpointing mechanism interacts with durable storage for streams and
state. In general, it requires:
+ - 一个能够回放一段时间内数据的持久化数据源,例如持久化消息队列(例如 Apache Kafka、RabbitMQ、 Amazon Kinesis、
Google PubSub 等)或文件系统(例如 HDFS、 S3、 GFS、 NFS、 Ceph 等)。
+ - 存放状态的持久化存储,通常为分布式文件系统(比如 HDFS、 S3、 GFS、 NFS、 Ceph 等)。
- - A *persistent* (or *durable*) data source that can replay records for a
certain amount of time. Examples for such sources are persistent messages
queues (e.g., Apache Kafka, RabbitMQ, Amazon Kinesis, Google PubSub) or file
systems (e.g., HDFS, S3, GFS, NFS, Ceph, ...).
- - A persistent storage for state, typically a distributed filesystem (e.g.,
HDFS, S3, GFS, NFS, Ceph, ...)
+## 激活与配置 Checkpoint
+默认情况下,Checkpoint 是禁用的。通过调用 `StreamExecutionEnvironment` 的
`enableCheckpointing(n)` 来激活 Checkpoint,里面的 *n* 是进行 Checkpoint 的间隔,单位毫秒。
-## Enabling and Configuring Checkpointing
+Checkpoint 其他的属性包括:
-By default, checkpointing is disabled. To enable checkpointing, call
`enableCheckpointing(n)` on the `StreamExecutionEnvironment`, where *n* is the
checkpoint interval in milliseconds.
-
-Other parameters for checkpointing include:
-
- - *exactly-once vs. at-least-once*: You can optionally pass a mode to the
`enableCheckpointing(n)` method to choose between the two guarantee levels.
- Exactly-once is preferable for most applications. At-least-once may be
relevant for certain super-low-latency (consistently few milliseconds)
applications.
-
- - *checkpoint timeout*: The time after which a checkpoint-in-progress is
aborted, if it did not complete by then.
-
- - *minimum time between checkpoints*: To make sure that the streaming
application makes a certain amount of progress between checkpoints,
- one can define how much time needs to pass between checkpoints. If this
value is set for example to *5000*, the next checkpoint will be
- started no sooner than 5 seconds after the previous checkpoint completed,
regardless of the checkpoint duration and the checkpoint interval.
- Note that this implies that the checkpoint interval will never be smaller
than this parameter.
+ - *精确一次(exactly-once) 对比 至少一次(at-least-once)*:你可以选择向
`enableCheckpointing(n)` 方法中传入一个模式来选择使用两种保证等级中的哪一种。
+ 对于大多数应用来说,精确一次是较好的选择。至少一次可能与某些延迟超低(始终只有几毫秒)的应用的关联较大。
+
+ - *Checkpoint超时(checkpoint timeout)*:如果过了这个时间,还在进行中的 checkpoint 操作就会被抛弃。
Review comment:
```suggestion
- *Checkpoint 超时(checkpoint timeout)*:如果过了这个时间,还在进行中的 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