Package com.linkedin.venice.utils
Class PubSubHelper.MutableDefaultPubSubMessage
java.lang.Object
com.linkedin.venice.utils.PubSubHelper.MutableDefaultPubSubMessage
- All Implemented Interfaces:
Measurable
,DefaultPubSubMessage
,PubSubMessage<KafkaKey,
KafkaMessageEnvelope, PubSubPosition>
- Enclosing class:
- PubSubHelper
public static class PubSubHelper.MutableDefaultPubSubMessage
extends Object
implements DefaultPubSubMessage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getKey()
Retrieves the key associated with this message.int
Retrieves the position of this message within the underlying topic-partition.long
long
long
getValue()
Retrieves the value payload of this message.boolean
setPosition
(PubSubPosition position) setTimestampAfterProduce
(long timestampAfterProduce) setTimestampBeforeProduce
(long timestampBeforeProduce) setTopicPartition
(PubSubTopicPartition topicPartition) setValue
(KafkaMessageEnvelope value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.linkedin.venice.pubsub.api.DefaultPubSubMessage
getOffset
Methods inherited from interface com.linkedin.venice.pubsub.api.PubSubMessage
getPartition, getPubSubMessageHeaders, getTopic, getTopicName
-
Constructor Details
-
MutableDefaultPubSubMessage
public MutableDefaultPubSubMessage()
-
-
Method Details
-
getKey
Description copied from interface:DefaultPubSubMessage
Retrieves the key associated with this message.- Specified by:
getKey
in interfaceDefaultPubSubMessage
- Specified by:
getKey
in interfacePubSubMessage<KafkaKey,
KafkaMessageEnvelope, PubSubPosition> - Returns:
- the
KafkaKey
representing the message key.
-
getValue
Description copied from interface:DefaultPubSubMessage
Retrieves the value payload of this message.- Specified by:
getValue
in interfaceDefaultPubSubMessage
- Specified by:
getValue
in interfacePubSubMessage<KafkaKey,
KafkaMessageEnvelope, PubSubPosition> - Returns:
- the
KafkaMessageEnvelope
containing the message data.
-
getTopicPartition
- Specified by:
getTopicPartition
in interfacePubSubMessage<KafkaKey,
KafkaMessageEnvelope, PubSubPosition> - Returns:
- the topic-partition this message belongs to
-
getPosition
Description copied from interface:DefaultPubSubMessage
Retrieves the position of this message within the underlying topic-partition.- Specified by:
getPosition
in interfaceDefaultPubSubMessage
- Returns:
- the
PubSubPosition
representing the message offset.
-
getPubSubMessageTime
public long getPubSubMessageTime()- Specified by:
getPubSubMessageTime
in interfacePubSubMessage<KafkaKey,
KafkaMessageEnvelope, PubSubPosition> - Returns:
- the timestamp at which the message was persisted in the pub sub system
-
getPayloadSize
public int getPayloadSize()- Specified by:
getPayloadSize
in interfacePubSubMessage<KafkaKey,
KafkaMessageEnvelope, PubSubPosition> - Returns:
- the size in bytes of the key + value.
-
isEndOfBootstrap
public boolean isEndOfBootstrap()- Specified by:
isEndOfBootstrap
in interfacePubSubMessage<KafkaKey,
KafkaMessageEnvelope, PubSubPosition> - Returns:
- whether this message marks the end of bootstrap.
-
setKey
-
setValue
-
setTopicPartition
public PubSubHelper.MutableDefaultPubSubMessage setTopicPartition(PubSubTopicPartition topicPartition) -
setPosition
-
setTimestampBeforeProduce
public PubSubHelper.MutableDefaultPubSubMessage setTimestampBeforeProduce(long timestampBeforeProduce) -
setTimestampAfterProduce
public PubSubHelper.MutableDefaultPubSubMessage setTimestampAfterProduce(long timestampAfterProduce) -
getTimestampBeforeProduce
public long getTimestampBeforeProduce() -
getTimestampAfterProduce
public long getTimestampAfterProduce() -
getHeapSize
public int getHeapSize()- Specified by:
getHeapSize
in interfaceMeasurable
-