XBaith commented on a change in pull request #11808: URL: https://github.com/apache/flink/pull/11808#discussion_r416851300
########## File path: docs/dev/stream/operators/process_function.zh.md ########## @@ -284,30 +282,31 @@ override def onTimer(timestamp: Long, ctx: OnTimerContext, out: Collector[OUT]): ## Timers -Both types of timers (processing-time and event-time) are internally maintained by the `TimerService` and enqueued for execution. +两种计时器(处理时间计时器和事件时间计时器)都在 `TimerService` 内部维护,并排队等待执行。 -The `TimerService` deduplicates timers per key and timestamp, i.e., there is at most one timer per key and timestamp. If multiple timers are registered for the same timestamp, the `onTimer()` method will be called just once. +对于相同的键和时间戳,`TimerService` 会删除重复的计时器,即每个键和时间戳最多有一个计时器。如果为同一时间戳注册了多个计时器,则只调用一次 `onTimer()` 方法。 -<span class="label label-info">Note</span> Flink synchronizes invocations of `onTimer()` and `processElement()`. Hence, users do not have to worry about concurrent modification of state. +<span class="label label-info">注意</span> Flink 会同步 `onTimer()` 和 `processElement()` 的调用,因此用户不必担心状态的并发修改。 ### Fault Tolerance -Timers are fault tolerant and checkpointed along with the state of the application. -In case of a failure recovery or when starting an application from a savepoint, the timers are restored. +计时器支持容错,它会和应用程序的状态一起进行 checkpoint。 +当进行故障恢复或从保存点启动应用程序时,计时器也会被恢复。 -<span class="label label-info">Note</span> Checkpointed processing-time timers that were supposed to fire before their restoration, will fire immediately. -This might happen when an application recovers from a failure or when it is started from a savepoint. +<span class="label label-info">注意</span> 在恢复之前就应该触发的处理时间计时器会立即触发。 +当应用程序从故障中恢复或从保存点启动时,可能会发生这种情况。 -<span class="label label-info">Note</span> Timers are always asynchronously checkpointed, except for the combination of RocksDB backend / with incremental snapshots / with heap-based timers (will be resolved with `FLINK-10026`). -Notice that large numbers of timers can increase the checkpointing time because timers are part of the checkpointed state. See the "Timer Coalescing" section for advice on how to reduce the number of timers. +<span class="label label-info">注意</span> 计时器总是异步 checkpoint,除非和 RocksDB backend / 增量snapshots / heap-based 计时器组合在一起(将会在 `FLINK-10026` 解决)。 Review comment: ```suggestion <span class="label label-info">注意</span> 计时器总是异步 checkpoint,除非和 RocksDB backend / 增量 snapshots / heap-based 计时器组合在一起(将会在 `FLINK-10026` 解决)。 ``` ---------------------------------------------------------------- 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: us...@infra.apache.org