Package org.apache.pinot.spi.stream
Class StreamMessage<T>
- java.lang.Object
-
- org.apache.pinot.spi.stream.StreamMessage<T>
-
- Direct Known Subclasses:
MessageBatch.LegacyStreamMessage
public class StreamMessage<T> extends Object
Represents a Stream message which includes the following components: 1. record key (optional) 2. record value (required) 3. StreamMessageMetadata (optional) - encapsulates record headers and metadata associated with a stream message (such as a message identifier, publish timestamp, user-provided headers etc) Similar to value decoder, each implementing stream plugin can have a key decoder and header extractor. If the key and header extractions are enabled for the table, the schema will automatically contain these fields as: "__header$HEADER_KEY" or "__metadata$RECORD_TIMESTAMP" These columns can be treated similar to any other Pinot table column. Usability note: In order to achieve this, table configuration should enable "populate metadata" option. Additionally, the pinot table schema should refer these fields. Otherwise, even though the fields are extracted, they will not materialize in the pinot table.
-
-
Field Summary
Fields Modifier and Type Field Description protected StreamMessageMetadata_metadata
-
Constructor Summary
Constructors Constructor Description StreamMessage(byte[] key, T value, StreamMessageMetadata metadata, int length)StreamMessage(T value, int length)
-
-
-
Field Detail
-
_metadata
protected final StreamMessageMetadata _metadata
-
-
Constructor Detail
-
StreamMessage
public StreamMessage(@Nullable byte[] key, T value, @Nullable StreamMessageMetadata metadata, int length)
-
StreamMessage
public StreamMessage(T value, int length)
-
-
Method Detail
-
getValue
public T getValue()
-
getLength
public int getLength()
-
getMetadata
@Nullable public StreamMessageMetadata getMetadata()
-
getKey
@Nullable public byte[] getKey()
-
-