Interface TypedEventWriter
- All Known Subinterfaces:
StateWriter
public interface TypedEventWriter
-
Method Summary
Modifier and TypeMethodDescriptionvoidappendFollowUpEvent(long key, Intent intent, RecordValue value) Append a follow up event to the result builderbooleancanWriteEventOfLength(int eventLength) Use this to know whether you can write an event of this length.
-
Method Details
-
appendFollowUpEvent
Append a follow up event to the result builder- Parameters:
key- the key of the eventintent- the intent of the eventvalue- the record of the event- Throws:
ExceededBatchRecordSizeException- if the appended event doesn't fit into the RecordBatch
-
canWriteEventOfLength
boolean canWriteEventOfLength(int eventLength) 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; }- Parameters:
eventLength- the length of the event that will be written- Returns:
- true if an event of length
eventLengthcan be written
-