public class IncomingMessageEnvelope
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
END_OF_STREAM_OFFSET |
Constructor and Description |
---|
IncomingMessageEnvelope(SystemStreamPartition systemStreamPartition,
java.lang.String offset,
java.lang.Object key,
java.lang.Object message)
Constructs a new IncomingMessageEnvelope from specified components.
|
IncomingMessageEnvelope(SystemStreamPartition systemStreamPartition,
java.lang.String offset,
java.lang.Object key,
java.lang.Object message,
int size)
Constructs a new IncomingMessageEnvelope from specified components.
|
IncomingMessageEnvelope(SystemStreamPartition systemStreamPartition,
java.lang.String offset,
java.lang.Object key,
java.lang.Object message,
int size,
long eventTime,
long arrivalTime)
Constructs a new IncomingMessageEnvelope from specified components
|
Modifier and Type | Method and Description |
---|---|
static IncomingMessageEnvelope |
buildDrainMessage(SystemStreamPartition ssp,
java.lang.String runId) |
static IncomingMessageEnvelope |
buildEndOfStreamEnvelope(SystemStreamPartition ssp)
This method is deprecated in favor of WatermarkManager.buildEndOfStreamEnvelope(SystemStreamPartition ssp).
|
static IncomingMessageEnvelope |
buildWatermarkEnvelope(SystemStreamPartition ssp,
long watermark) |
boolean |
equals(java.lang.Object obj) |
long |
getArrivalTime()
Getter for arrival time
|
long |
getEventTime()
Getter for event time
|
java.lang.Object |
getKey() |
java.lang.Object |
getMessage() |
java.lang.String |
getOffset()
Offset associated with this message, provided by the system consumer that consumed the message.
|
int |
getSize() |
SystemStreamPartition |
getSystemStreamPartition() |
SystemStreamPartition |
getSystemStreamPartition(int elasticityFactor)
fetches the SSP (with keybucket) for the envelope based on elasticity factor.
|
int |
hashCode() |
boolean |
isDrain() |
boolean |
isEndOfStream() |
boolean |
isWatermark() |
java.lang.String |
toString() |
public IncomingMessageEnvelope(SystemStreamPartition systemStreamPartition, java.lang.String offset, java.lang.Object key, java.lang.Object message)
systemStreamPartition
- The aggregate object representing the incoming stream name, the name of the cluster
from which the stream came, and the partition of the stream from which the message was received.offset
- offset associated with this message, provided by the system consumer that consumed the messagekey
- A deserialized key received from the partition offset.message
- A deserialized message received from the partition offset.public IncomingMessageEnvelope(SystemStreamPartition systemStreamPartition, java.lang.String offset, java.lang.Object key, java.lang.Object message, int size)
systemStreamPartition
- The aggregate object representing the incoming stream name, the name of the cluster
from which the stream came, and the partition of the stream from which the message was received.offset
- offset associated with this message, provided by the system consumer that consumed the messagekey
- A deserialized key received from the partition offset.message
- A deserialized message received from the partition offset.size
- size of the message and key in bytes.public IncomingMessageEnvelope(SystemStreamPartition systemStreamPartition, java.lang.String offset, java.lang.Object key, java.lang.Object message, int size, long eventTime, long arrivalTime)
systemStreamPartition
- The aggregate object representing the incoming stream name, the name of the cluster
from which the stream came, and the partition of the stream from which the message was received.offset
- offset associated with this message, provided by the system consumer that consumed the messagekey
- A deserialized key received from the partition offset.message
- A deserialized message received from the partition offset.size
- size of the message and key in bytes.eventTime
- the timestamp (in epochMillis) of when this event happenedarrivalTime
- the timestamp (in epochMillis) of when this event arrived to (i.e., was picked-up by) Samzapublic long getEventTime()
public long getArrivalTime()
public SystemStreamPartition getSystemStreamPartition()
public SystemStreamPartition getSystemStreamPartition(int elasticityFactor)
elasticityFactor
- public java.lang.String getOffset()
public java.lang.Object getKey()
public java.lang.Object getMessage()
public int getSize()
public boolean isEndOfStream()
public boolean isDrain()
public boolean isWatermark()
public static IncomingMessageEnvelope buildEndOfStreamEnvelope(SystemStreamPartition ssp)
ssp
- The SSP that is at end-of-stream.public static IncomingMessageEnvelope buildDrainMessage(SystemStreamPartition ssp, java.lang.String runId)
public static IncomingMessageEnvelope buildWatermarkEnvelope(SystemStreamPartition ssp, long watermark)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object