Interface MutableState<EventT,ResultT>

All Superinterfaces:
Serializable

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

    Modifier and Type
    Method
    Description
    void
    mutate(EventT event)
    The interface assumes that events will mutate the state without the possibility of throwing an error.
    This method is called after each state mutation.
  • Method Details

    • mutate

      void mutate(EventT event) throws Exception
      The interface assumes that events will mutate the state without the possibility of throwing an error.
      Parameters:
      event - to be processed
      Throws:
      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.