Class StreamMessageMetadata

  • All Implemented Interfaces:
    RowMetadata

    public class StreamMessageMetadata
    extends Object
    implements RowMetadata
    A class that provides metadata associated with the message of a stream, for e.g., timestamp derived from the incoming record (not the ingestion time).
    • Constructor Detail

      • StreamMessageMetadata

        public StreamMessageMetadata​(long recordIngestionTimeMs,
                                     @Nullable
                                     GenericRow headers)
      • StreamMessageMetadata

        public StreamMessageMetadata​(long recordIngestionTimeMs,
                                     @Nullable
                                     GenericRow headers,
                                     Map<String,​String> metadata)
        Construct the stream based message/row message metadata
        Parameters:
        recordIngestionTimeMs - the time that the message was ingested by the stream provider use Long.MIN_VALUE if not applicable
        metadata -
    • Method Detail

      • getRecordIngestionTimeMs

        public long getRecordIngestionTimeMs()
        Description copied from interface: RowMetadata
        Returns the timestamp associated with the record. This typically refers to the time it was ingested into the upstream source. In some cases, it may be the time at which the record was created, aka event time (eg. in kafka, a topic may be configured to use record `CreateTime` instead of `LogAppendTime`). Expected to be used for stream-based sources.
        Specified by:
        getRecordIngestionTimeMs in interface RowMetadata
        Returns:
        timestamp (epoch in milliseconds) when the row was ingested upstream Long.MIN_VALUE if not available
      • getRecordMetadata

        public Map<String,​String> getRecordMetadata()
        Description copied from interface: RowMetadata
        Returns the metadata associated with the stream record Kafka's record offset would be an example of a metadata associated with the record. Record metadata is typically stream specific and hence, it is defined as a Map of strings.
        Specified by:
        getRecordMetadata in interface RowMetadata
        Returns:
        A Map of record metadata entries.