Class EventApplyingStateWriter

java.lang.Object
io.camunda.zeebe.engine.processing.streamprocessor.writers.EventApplyingStateWriter
All Implemented Interfaces:
StateWriter, TypedEventWriter

public final class EventApplyingStateWriter extends Object implements StateWriter
A state writer that uses the event applier, to alter the state for each written event.

Note that it does not write events to the stream itself, but it delegates this to the TypedStreamWriter.

Note that it does not change the state itself, but delegates this to the EventApplier.

  • Constructor Details

  • Method Details

    • appendFollowUpEvent

      public void appendFollowUpEvent(long key, Intent intent, RecordValue value)
      Specified by:
      appendFollowUpEvent in interface TypedEventWriter
    • canWriteEventOfLength

      public boolean canWriteEventOfLength(int eventLength)
      Description copied from interface: TypedEventWriter
      Use this to know whether you can write an event of this length.

      Example:

      
       final TypedEventWriter writer;
       // ... assign the writer
       final TypedRecord<?> record;
       // ... assign record
       if (!writer.canWriteEventOfLength(record.getLength())) {
         // raise an incident or some such
         return;
       }
       
      Specified by:
      canWriteEventOfLength in interface TypedEventWriter
      Parameters:
      eventLength - the length of the event that will be written
      Returns:
      true if an event of length eventLength can be written
    • getMaxEventLength

      public int getMaxEventLength()
      Specified by:
      getMaxEventLength in interface TypedEventWriter
      Returns:
      the maximum event length