Re: 如何在KeyedProcessFunction中获取processingTime

2020-08-17 文章 shizk233
ctx.timestamp()其实就是获取的StreamRecord的时间戳,也就是事件被提取出来的时间戳。
这个方法一般需要使用event time,并且在数据流上assign过timestamp和watermark。

ゞ野蠻遊戲χ  于2020年8月16日周日 下午7:57写道:

> 大家好
>
>      
>   当我在KeyedProcessFunction的processElement方法中获取processingTime,就像这样ctx.timestamp(),返回为null,我改如何在processElement中获取processingTime?
>
>
> 谢谢!
> 嘉治


Re: 如何在KeyedProcessFunction中获取processingTime

2020-08-16 文章 Zhao,Yi(SEC)
根据Context获取timerService,然后获取处理时间即可。


在 2020/8/16 下午7:57,“ゞ野蠻遊戲χ” 写入:

大家好

      
  当我在KeyedProcessFunction的processElement方法中获取processingTime,就像这样ctx.timestamp(),返回为null,我改如何在processElement中获取processingTime?


谢谢!
嘉治