Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataStream
    • StreamExecutionEnvironment
    • DataStream
    • Functions
    • State
    • Timer
    • Window
    • Checkpoint
    • Side Outputs
    • Connectors
    • Formats
  • PyFlink Common

pyflink.datastream.functions.KeyedBroadcastProcessFunction#

class KeyedBroadcastProcessFunction(*args, **kwds)[source]#

A function to be applied to a BroadcastConnectedStream that connects BroadcastStream, i.e. a stream with broadcast state, with a KeyedStream.

The stream with the broadcast state can be created using the DataStream.broadcast() method.

The user has to implement two methods:

  • the process_broadcast_element() which will be applied to each element in the broadcast side

  • the process_element() which will be applied to the non-broadcasted/keyed side.

The process_broadcast_element() takes a context as an argument (among others), which allows it to read/write to the broadcast state, while the process_element() has read-only access to the broadcast state, but can read/write to the keyed state and register timers.

New in version 1.16.0.

Methods

close()

on_timer(timestamp, ctx)

Called when a timer set using TimerService fires.

open(runtime_context)

process_broadcast_element(value, ctx)

This method is called for each element in the BroadcastStream.

process_element(value, ctx)

This method is called for each element in the (non-broadcast) KeyedStream.

previous

pyflink.datastream.functions.BroadcastProcessFunction

next

State

Show Source

Created using Sphinx 4.5.0.