Class ExternalEvent

  • All Implemented Interfaces:
    java.io.Externalizable , java.io.Serializable , java.lang.Comparable , org.apache.avro.generic.GenericContainer , org.apache.avro.generic.GenericRecord , org.apache.avro.generic.IndexedRecord , org.apache.avro.specific.SpecificRecord

    
    public class ExternalEvent
    extends SpecificRecordBase implements SpecificRecord
                        

    Events sent to workers that are triggered from flow APIs

    • Constructor Detail

      • ExternalEvent

        ExternalEvent()
        Default constructor.
      • ExternalEvent

        ExternalEvent(String topic, ByteBuffer key, ByteBuffer payload, Instant timestamp)
        All-args constructor.
        Parameters:
        topic - The topic that the external event is sent to.
        key - Avro serialized representation of the key that the external event is partitioned by.
        payload - Avro serialized representation of the payload that the external processor will process.
        timestamp - Time ([Instant]) in milliseconds when the external event was created.
    • Method Detail

      • setTopic

         void setTopic(String value)

        Sets the value of the 'topic' field. The topic that the external event is sent to.

        Parameters:
        value - the value to set.
      • setKey

         void setKey(ByteBuffer value)

        Sets the value of the 'key' field. Avro serialized representation of the key that the external event is partitioned by.

        Parameters:
        value - the value to set.
      • setPayload

         void setPayload(ByteBuffer value)

        Sets the value of the 'payload' field. Avro serialized representation of the payload that the external processor will process.

        Parameters:
        value - the value to set.
      • setTimestamp

         void setTimestamp(Instant value)

        Sets the value of the 'timestamp' field. Time ([Instant]) in milliseconds when the external event was created.

        Parameters:
        value - the value to set.
      • getEncoder

         static BinaryMessageEncoder<ExternalEvent> getEncoder()

        Return the BinaryMessageEncoder instance used by this class.

      • getDecoder

         static BinaryMessageDecoder<ExternalEvent> getDecoder()

        Return the BinaryMessageDecoder instance used by this class.

      • createDecoder

         static BinaryMessageDecoder<ExternalEvent> createDecoder(SchemaStore resolver)

        Create a new BinaryMessageDecoder instance for this class that uses the specified SchemaStore.

        Parameters:
        resolver - a SchemaStore used to find schemas by fingerprint
      • fromByteBuffer

         static ExternalEvent fromByteBuffer(ByteBuffer b)

        Deserializes a ExternalEvent from a ByteBuffer.

        Parameters:
        b - a byte buffer holding serialized data for an instance of this class