Class ProcessingStateMachine

java.lang.Object
io.camunda.zeebe.engine.processing.streamprocessor.ProcessingStateMachine

public final class ProcessingStateMachine extends Object
Represents the processing state machine, which is executed on normal processing.

 +-----------------+             +--------------------+
 |                 |             |                    |      exception
 | readNextEvent() |------------>|   processEvent()   |------------------+
 |                 |             |                    |                  v
 +-----------------+             +--------------------+            +---------------+
           ^                             |                         |               |------+
           |                             |         +-------------->|   onError()   |      | exception
           |                             |         |  exception    |               |<-----+
           |                     +-------v-------------+           +---------------+
           |                     |                     |                 |
           |                     |    writeEvent()     |                 |
           |                     |                     |<----------------+
 +----------------------+        +---------------------+
 |                      |                 |
 | executeSideEffects() |                 v
 |                      |       +----------------------+
 +----------------------+       |                      |
           ^                    |     updateState()    |
           +--------------------|                      |
                                +----------------------+
                                       ^      |
                                       |      | exception
                                       |      |
                                    +---------v----+
                                    |              |
                                    |   onError()  |
                                    |              |
                                    +--------------+
                                       ^     |
                                       |     |  exception
                                       +-----+

 
  • Constructor Details

  • Method Details

    • hasReachedEnd

      public boolean hasReachedEnd()
      Be aware this is a transient property which can change anytime, e.g. if a new command is written to the log.
      Returns:
      true if the ProcessingStateMachine has reached the end of the log and nothing is left to being processed/applied, false otherwise
    • setSideEffectProducer

      public void setSideEffectProducer(SideEffectProducer sideEffectProducer)
    • getLastSuccessfulProcessedEventPosition

      public long getLastSuccessfulProcessedEventPosition()
    • getLastWrittenPosition

      public long getLastWrittenPosition()
    • isMakingProgress

      public boolean isMakingProgress()
    • startProcessing

      public void startProcessing(LastProcessingPositions lastProcessingPositions)