Class EventApplyingStateWriter
java.lang.Object
io.camunda.zeebe.engine.processing.streamprocessor.writers.EventApplyingStateWriter
- All Implemented Interfaces:
StateWriter,TypedEventWriter
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 Summary
ConstructorsConstructorDescriptionEventApplyingStateWriter(TypedEventWriter eventWriter, EventApplier eventApplier) -
Method Summary
Modifier and TypeMethodDescriptionvoidappendFollowUpEvent(long key, Intent intent, RecordValue value) booleancanWriteEventOfLength(int eventLength) Use this to know whether you can write an event of this length.int
-
Constructor Details
-
EventApplyingStateWriter
-
-
Method Details
-
appendFollowUpEvent
- Specified by:
appendFollowUpEventin interfaceTypedEventWriter
-
canWriteEventOfLength
public boolean canWriteEventOfLength(int eventLength) Description copied from interface:TypedEventWriterUse 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:
canWriteEventOfLengthin interfaceTypedEventWriter- Parameters:
eventLength- the length of the event that will be written- Returns:
- true if an event of length
eventLengthcan be written
-
getMaxEventLength
public int getMaxEventLength()- Specified by:
getMaxEventLengthin interfaceTypedEventWriter- Returns:
- the maximum event length
-