Class OrderedEventProcessor<EventT,​EventKeyT,​ResultT,​StateT extends MutableState<EventT,​ResultT>>

  • Type Parameters:
    EventT - type of event
    EventKeyT - type of event key
    StateT - type of the state
    All Implemented Interfaces:
    java.io.Serializable, org.apache.beam.sdk.transforms.display.HasDisplayData

    public abstract class OrderedEventProcessor<EventT,​EventKeyT,​ResultT,​StateT extends MutableState<EventT,​ResultT>>
    extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<EventKeyT,​org.apache.beam.sdk.values.KV<java.lang.Long,​EventT>>>,​OrderedEventProcessorResult<EventKeyT,​ResultT,​EventT>>
    Transform for processing ordered events. Events are grouped by the key and within each key they are applied according to the provided sequence. Events which arrive out of sequence are buffered and processed after all the missing events for a given key have arrived.

    There are two sequencing modes - a sequence per key and a global sequence. See OrderedProcessingHandler for details on how to configure this transform.

    Notice: the global sequence processing on the Dataflow Runner requires running under Runner V2. Refer to Dataflow documentation for details.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String GLOBAL_SEQUENCE_TRACKER  
      • Fields inherited from class org.apache.beam.sdk.transforms.PTransform

        annotations, displayData, name, resourceHints
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static <EventTypeT,​EventKeyTypeT,​ResultTypeT,​StateTypeT extends MutableState<EventTypeT,​ResultTypeT>>
      OrderedEventProcessor<EventTypeT,​EventKeyTypeT,​ResultTypeT,​StateTypeT>
      create​(OrderedProcessingHandler<EventTypeT,​EventKeyTypeT,​StateTypeT,​ResultTypeT> handler)
      Create the transform.
      OrderedEventProcessorResult<EventKeyT,​ResultT,​EventT> expand​(org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<EventKeyT,​org.apache.beam.sdk.values.KV<java.lang.Long,​EventT>>> input)  
      • Methods inherited from class org.apache.beam.sdk.transforms.PTransform

        addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • GLOBAL_SEQUENCE_TRACKER

        public static final java.lang.String GLOBAL_SEQUENCE_TRACKER
        See Also:
        Constant Field Values
    • Constructor Detail

      • OrderedEventProcessor

        public OrderedEventProcessor()
    • Method Detail

      • create

        public static <EventTypeT,​EventKeyTypeT,​ResultTypeT,​StateTypeT extends MutableState<EventTypeT,​ResultTypeT>> OrderedEventProcessor<EventTypeT,​EventKeyTypeT,​ResultTypeT,​StateTypeT> create​(OrderedProcessingHandler<EventTypeT,​EventKeyTypeT,​StateTypeT,​ResultTypeT> handler)
        Create the transform.
        Type Parameters:
        EventTypeT - type of event
        EventKeyTypeT - type of event key
        ResultTypeT - type of the result object
        StateTypeT - type of the state to store
        Parameters:
        handler - provides the configuration of this transform
        Returns:
        the transform