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 TypeMethodDescriptionintgetKey()Retrieves the key associated with this message.intRetrieves the position of this message within the underlying topic-partition.longlonglonggetValue()Retrieves the value payload of this message.booleansetPosition(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, waitMethods inherited from interface com.linkedin.venice.pubsub.api.PubSubMessage
getOffset, getPartition, getPubSubMessageHeaders, getReplicationMetadataPayload, getTopic, getTopicName, getWriterSchemaId
-
Constructor Details
-
MutableDefaultPubSubMessage
public MutableDefaultPubSubMessage()
-
-
Method Details
-
getKey
Description copied from interface:DefaultPubSubMessageRetrieves the key associated with this message.- Specified by:
getKeyin interfaceDefaultPubSubMessage- Specified by:
getKeyin interfacePubSubMessage<KafkaKey,KafkaMessageEnvelope, PubSubPosition> - Returns:
- the
KafkaKeyrepresenting the message key.
-
getValue
Description copied from interface:DefaultPubSubMessageRetrieves the value payload of this message.- Specified by:
getValuein interfaceDefaultPubSubMessage- Specified by:
getValuein interfacePubSubMessage<KafkaKey,KafkaMessageEnvelope, PubSubPosition> - Returns:
- the
KafkaMessageEnvelopecontaining the message data.
-
getTopicPartition
- Specified by:
getTopicPartitionin interfacePubSubMessage<KafkaKey,KafkaMessageEnvelope, PubSubPosition> - Returns:
- the topic-partition this message belongs to
-
getPosition
Description copied from interface:DefaultPubSubMessageRetrieves the position of this message within the underlying topic-partition.- Specified by:
getPositionin interfaceDefaultPubSubMessage- Specified by:
getPositionin interfacePubSubMessage<KafkaKey,KafkaMessageEnvelope, PubSubPosition> - Returns:
- the
PubSubPositionrepresenting the message offset.
-
getPubSubMessageTime
public long getPubSubMessageTime()- Specified by:
getPubSubMessageTimein interfacePubSubMessage<KafkaKey,KafkaMessageEnvelope, PubSubPosition> - Returns:
- the timestamp at which the message was persisted in the pub sub system
-
getPayloadSize
public int getPayloadSize()- Specified by:
getPayloadSizein interfacePubSubMessage<KafkaKey,KafkaMessageEnvelope, PubSubPosition> - Returns:
- the size in bytes of the key + value.
-
isEndOfBootstrap
public boolean isEndOfBootstrap()- Specified by:
isEndOfBootstrapin 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:
getHeapSizein interfaceMeasurable
-