RocMarshal commented on a change in pull request #11979:
URL: https://github.com/apache/flink/pull/11979#discussion_r422005339
##########
File path: docs/training/event_driven.zh.md
##########
@@ -202,52 +196,48 @@ public void onTimer(
}
{% endhighlight %}
-Observations:
+观察:
-* The `OnTimerContext context` passed in to `onTimer` can be used to determine
the current key.
+* 传递给 `onTimer` 的 `OnTimerContext context` 可用于确定当前 key。
-* Our pseudo-windows are being triggered when the current watermark reaches
the end of each hour, at
- which point `onTimer` is called. This onTimer method removes the related
entry from `sumOfTips`,
- which has the effect of making it impossible to accommodate late events.
This is the equivalent of
- setting the allowedLateness to zero when working with Flink's time windows.
+* 我们的 pseudo-windows 在当前 Watermark 到达每小时结束时触发,此时调用 `onTimer`。
+ 这个 `onTimer` 方法从 `sumOfTips` 中删除相关的条目,这样做的效果是不可能容纳延迟的事件。
+ 这相当于在使用 Flink 的时间窗口时将 allowedLateness 设置为零。
-### Performance Considerations
+### 性能考虑
-Flink provides `MapState` and `ListState` types that are optimized for
RocksDB. Where possible,
-these should be used instead of a `ValueState` object holding some sort of
collection. The RocksDB
-state backend can append to `ListState` without going through
(de)serialization, and for `MapState`, each
-key/value pair is a separate RocksDB object, so `MapState` can be efficiently
accessed and updated.
+在可能的情况下,应该使用这些对象,而不是持有某种集合的 `ValueState` 对象。
+Flink 提供了为 RocksDB 优化的 `MapState` 和 `ListState` 类型。
+在可能的情况下,应该使用这些对象,而不是持有某种集合的 `ValueState` 对象。
+RocksDB State Backend 可以附加到 `ListState`,而无需进行(反)序列化,
+对于 `MapState`,每个 key/value 都是一个单独的 RocksDB 对象,因此可以有效地访问和更新 `MapState`。
{% top %}
## Side Outputs
-### Introduction
+### 介绍
-There are several good reasons to want to have more than one output stream
from a Flink operator, such as reporting:
+有几个很好的理由希望从 Flink 算子获得多个输出流,如下报告条目:
-* exceptions
-* malformed events
-* late events
-* operational alerts, such as timed-out connections to external services
+* 异常情况(exceptions)
+* 格式错误的事件(malformed events)
+* 迟到的事件(late events)
+* operator 告警(operational alerts),如与外部服务的连接超时
-Side outputs are a convenient way to do this. Beyond error reporting, side
outputs are also
-a good way to implement an n-way split of a stream.
+旁路输出(Side outputs)是一种方便的方法。除了错误报告之外,旁路输出也是实现流的 n 路分割的好方法。
-### Example
+### 示例
-You are now in a position to do something with the late events that were
ignored in the previous
-section.
+现在你可以对上一节中忽略的延迟事件执行某些操作。
-A side output channel is associated with an `OutputTag<T>`. These tags have
generic types that
-correspond to the type of the side output's `DataStream`, and they have names.
+Side output channel 与 `OutputTag<T>` 相关联。这些标记具有与 Side output 的 `DataStream`
类型相对应的泛型类型,并且它们具有名称。
Review comment:
Hi, @klion26
I have made corresponding improvements according your suggestion and the
original text. Thank you so much.
Sincerely,
Roc
----------------------------------------------------------------
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]