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
ConstructorDescriptionEventApplyingStateWriter
(TypedEventWriter eventWriter, EventApplier eventApplier) -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendFollowUpEvent
(long key, Intent intent, RecordValue value) boolean
canWriteEventOfLength
(int eventLength) Use this to know whether you can write an event of this length.int
-
Constructor Details
-
EventApplyingStateWriter
-
-
Method Details
-
appendFollowUpEvent
- Specified by:
appendFollowUpEvent
in interfaceTypedEventWriter
-
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 interfaceTypedEventWriter
- 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 interfaceTypedEventWriter
- Returns:
- the maximum event length
-