XBaith commented on a change in pull request #11808:
URL: https://github.com/apache/flink/pull/11808#discussion_r416852273
##########
File path: docs/dev/stream/operators/process_function.zh.md
##########
@@ -140,23 +139,23 @@ public class CountWithTimeoutFunction
Context ctx,
Collector<Tuple2<String, Long>> out) throws Exception {
- // retrieve the current count
+ // 获得当前的数量
CountWithTimestamp current = state.value();
if (current == null) {
current = new CountWithTimestamp();
current.key = value.f0;
}
- // update the state's count
+ // 更新状态中的数量
current.count++;
- // set the state's timestamp to the record's assigned event time
timestamp
+ // 将状态中的最后修改时间改为记录的事件时间
current.lastModified = ctx.timestamp();
- // write the state back
+ // 将更新后的状态写回
state.update(current);
- // schedule the next timer 60 seconds from the current event time
+ // 注册一个60s之后的事件时间回调
Review comment:
```suggestion
// 注册一个 60s 之后的事件时间回调
```
----------------------------------------------------------------
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]