一、概念:处理函数(底层API),可以访问时间戳,水位线以及注册定时时间,还可以输出特定事件(超时事件)
Flink主要提供了8个ProcessFunction(斜体标注的重要):
二、重点解读其中几个API
Non-keyed-strema(没有分流的)
ProcessFunction[In,Out]
processElemnt:来一条数据处理一次
onTimer:定时器
KeyedProcedssFunction[Key,In,Out]
processElement:来一条数据处理一次
onTimer:定时器
WindowedStream(分流开窗)
ProcessWindowFunction[In,Out,Key,TimeWindow]
process
ConnectStream(两条流的合并)
CoprocerssFunction
processelements1 处理第一条流
procesElements2 处理第二条流
onTimer 定时器
原文:https://www.cnblogs.com/atBruce/p/13137685.html