Package org.apache.pinot.spi.stream
Class StreamMessageMetadata
- java.lang.Object
-
- org.apache.pinot.spi.stream.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).
-
-
Field Summary
-
Fields inherited from interface org.apache.pinot.spi.stream.RowMetadata
EMPTY_COLLECTION, EMPTY_ROW
-
-
Constructor Summary
Constructors Constructor Description StreamMessageMetadata(long recordIngestionTimeMs, GenericRow headers)StreamMessageMetadata(long recordIngestionTimeMs, GenericRow headers, Map<String,String> metadata)Construct the stream based message/row message metadata
-
Method Summary
Modifier and Type Method Description GenericRowgetHeaders()Returns the stream message headerslonggetRecordIngestionTimeMs()Returns the timestamp associated with the record.Map<String,String>getRecordMetadata()Returns the metadata associated with the stream record Kafka's record offset would be an example of a metadata associated with the record.
-
-
-
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 applicablemetadata-
-
-
Method Detail
-
getRecordIngestionTimeMs
public long getRecordIngestionTimeMs()
Description copied from interface:RowMetadataReturns 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:
getRecordIngestionTimeMsin interfaceRowMetadata- Returns:
- timestamp (epoch in milliseconds) when the row was ingested upstream Long.MIN_VALUE if not available
-
getHeaders
public GenericRow getHeaders()
Description copied from interface:RowMetadataReturns the stream message headers- Specified by:
getHeadersin interfaceRowMetadata- Returns:
- A
GenericRowthat encapsulates the headers in the ingested row
-
getRecordMetadata
public Map<String,String> getRecordMetadata()
Description copied from interface:RowMetadataReturns 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:
getRecordMetadatain interfaceRowMetadata- Returns:
- A Map of record metadata entries.
-
-