关于Flink--ProcessFunction的使用

一、概念:

处理函数(底层API),可以访问时间戳,水位线以及注册定时时间,还可以输出特定事件(超时事件)

Flink主要提供了8个ProcessFunction(斜体标注的重要):

  • ProcessFunction
  • KeyedProcessFunction
  • CoProcessFunction
  • ProcessJoinFunction
  • BroadcastProcessFunction
  • KeyedBroadcastProcessFunction
  • ProcessWindowFunction
  • ProcessAllWindowFunction

二、重点解读其中几个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 定时器

 

    

 

posted @ 2020-06-15 20:37  七寸青衫  阅读(788)  评论(0编辑  收藏  举报
loading: { rebound: { tension: 16, }, spinner: { id: 'spinner', radius: 90, } }