RocMarshal commented on a change in pull request #11979: URL: https://github.com/apache/flink/pull/11979#discussion_r422002930
########## File path: docs/training/event_driven.zh.md ########## @@ -269,38 +259,35 @@ SingleOutputStreamOperator hourlyTips = fares hourlyTips.getSideOutput(lateFares).print(); {% endhighlight %} -Alternatively, you can use two OutputTags with the -same name to refer to the same side output, but if you do, they must have the same type. +或者,可以使用两个同名的 OutputTag 来引用同一个旁路输出,但如果这样做,它们必须具有相同的类型。 {% top %} -## Closing Remarks +## 结语 -In this example you have seen how a `ProcessFunction` can be used to reimplement a straightforward time -window. Of course, if Flink's built-in windowing API meets your needs, by all means, go ahead and -use it. But if you find yourself considering doing something contorted with Flink's windows, don't -be afraid to roll your own. +在本例中,你已经了解了如何使用 `ProcessFunction` 重新实现一个简单的时间窗口。 +当然,如果 Flink 内置的窗口 API 能够满足你的开发需求,那么一定要优先使用它。 +但如果你发现自己在考虑用 Flink 的窗口做些错综复杂的事情,不要害怕自己动手。 -Also, `ProcessFunctions` are useful for many other use cases beyond computing analytics. The hands-on -exercise below provides an example of something completely different. +此外,`ProcessFunctions` 对于计算分析之外的许多其他用例也很有用。 +下面的实践练习提供了一个完全不同的例子。 -Another common use case for ProcessFunctions is for expiring stale state. If you think back to the -[Rides and Fares Exercise](https://github.com/apache/flink-training/tree/{% if site.is_stable %}release-{{ site.version_title }}{% else %}master{% endif %}/rides-and-fares), -where a `RichCoFlatMapFunction` is used to compute a simple join, the sample solution assumes that -the TaxiRides and TaxiFares are perfectly matched, one-to-one for each `rideId`. If an event is lost, -the other event for the same `rideId` will be held in state forever. This could instead be implemented -as a `KeyedCoProcessFunction`, and a timer could be used to detect and clear any stale state. +ProcessFunctions 的另一个常见用例是过期过时 State。如果你回想一下 +[Rides and Fares Exercise](https://github.com/apache/flink-training/tree/{% if site.is_stable %}release-{{ site.version_title }}{% else %}master{% endif %}/rides-and-fares), +其中使用 `RichCoFlatMapFunction` 来计算简单 Join,那么示例解决方案假设 TaxiRides 和 TaxiFares +完全匹配,每个 `rideId` 一对一。如果某个事件丢失,则同一 `rideId` 的另一个事件将永远保持 State。 Review comment: @klion26 Hi, @klion26 I re-integrated the entire scene of the example to translate these sentences more semantically and apply your suggestions. If you have any better suggestions, please leave comments, I will continue to improve it. From the bottom of my heart, thank you so much for your guidance and help ! 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: us...@infra.apache.org