All Known Subinterfaces:
StateWriter

public interface TypedEventWriter
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    appendFollowUpEvent(long key, Intent intent, RecordValue value)
    Append a follow up event to the result builder
    boolean
    canWriteEventOfLength(int eventLength)
    Use this to know whether you can write an event of this length.
  • Method Details

    • appendFollowUpEvent

      void appendFollowUpEvent(long key, Intent intent, RecordValue value)
      Append a follow up event to the result builder
      Parameters:
      key - the key of the event
      intent - the intent of the event
      value - 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 eventLength can be written