ark::pipeline::DataEnvelope

Defined in header “ark/pipeline/data_envelope.hh”.


This envelope type wraps raw serialized data, rather than a type. Calling payload() will deserialize and give you data in the type you requested.

This is typically used when reading data from a log or over the comms system.

Methods

  • DataEnvelope(core::ByteBuffer buffer, TimeType publish_time, uint64_t sequence_number, DataEnvelopeFormat format, std::shared_ptr< const serialization::SchemaRegistry > message_schema_registry, std::string message_type_name)
    Constructor. Initializes the envelope against the given byte buffer.

  • ~DataEnvelope()
    Virtual destructor, for cleanup.

  • const TimeType & publish_time()
    Returns the time that this object was published.

  • uint64_t publisher_sequence_number()
    Returns the sequence number of this message with respect to messages published from a single publisher. In other words, if publisher ID is identical between envelopes, you should see this number increment monotnically.

  • serialization::JsonBlob to_json()
    Deserializes the buffer, then reserializes it as JSON.

  • core::ByteBuffer to_bytes()
    Returns the byte buffer that this envelope wraps.

  • std::shared_ptr< const Envelope< Type > > concrete_envelope()
    Returns the containing type, deserialized and contained within an envelope.

  • const std::type_info & message_type()
    Returns type identification information about the payload inside this envelope.

  • std::string message_type_name()
    Returns a string-form of the type identification information about the payload inside the envelope.

  • bool is_serializable()
    Returns true if the type that this envelopes contains identifies as being serializable.

  • uint64_t publisher_identifier()
    Returns the identifier of the publisher that constructed this envelope. You should not depend on this value to be unique or consistent across executions.