Interface MutableState<EventT,​ResultT>

  • All Superinterfaces:
    java.io.Serializable

    public interface MutableState<EventT,​ResultT>
    extends java.io.Serializable
    Mutable state mutates when events apply to it. It is stored in a Beam state.
    • Method Detail

      • mutate

        void mutate​(EventT event)
             throws java.lang.Exception
        The interface assumes that events will mutate the state without the possibility of throwing an error.
        Parameters:
        event - to be processed
        Throws:
        java.lang.Exception - if a checked exception is thrown, the event will be output into OrderedEventProcessorResult.unprocessedEvents() with
      • produceResult

        ResultT produceResult()
        This method is called after each state mutation.
        Returns:
        Result of the processing. Can be null if nothing needs to be output after this mutation.