Package com.linkedin.venice.pubsub
Class ImmutablePubSubMessage
java.lang.Object
com.linkedin.venice.pubsub.ImmutablePubSubMessage
- All Implemented Interfaces:
Measurable
,DefaultPubSubMessage
,PubSubMessage<KafkaKey,
KafkaMessageEnvelope, PubSubPosition>
-
Constructor Summary
ConstructorsConstructorDescriptionImmutablePubSubMessage
(KafkaKey key, KafkaMessageEnvelope value, PubSubTopicPartition topicPartition, PubSubPosition pubSubPosition, long timestamp, int payloadSize) ImmutablePubSubMessage
(KafkaKey key, KafkaMessageEnvelope value, PubSubTopicPartition topicPartition, PubSubPosition pubSubPosition, long timestamp, int payloadSize, PubSubMessageHeaders pubSubMessageHeaders) ImmutablePubSubMessage
(KafkaKey key, KafkaMessageEnvelope value, PubSubTopicPartition topicPartition, PubSubPosition pubSubPosition, long timestamp, int payloadSize, PubSubMessageHeaders pubSubMessageHeaders, int writerSchemaId, ByteBuffer replicationMetadataPayload) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.linkedin.venice.pubsub.api.PubSubMessage
getOffset, getPartition, getTopic, getTopicName
-
Constructor Details
-
ImmutablePubSubMessage
public ImmutablePubSubMessage(KafkaKey key, KafkaMessageEnvelope value, PubSubTopicPartition topicPartition, PubSubPosition pubSubPosition, long timestamp, int payloadSize) -
ImmutablePubSubMessage
public ImmutablePubSubMessage(KafkaKey key, KafkaMessageEnvelope value, PubSubTopicPartition topicPartition, PubSubPosition pubSubPosition, long timestamp, int payloadSize, PubSubMessageHeaders pubSubMessageHeaders) -
ImmutablePubSubMessage
public ImmutablePubSubMessage(KafkaKey key, KafkaMessageEnvelope value, PubSubTopicPartition topicPartition, PubSubPosition pubSubPosition, long timestamp, int payloadSize, PubSubMessageHeaders pubSubMessageHeaders, int writerSchemaId, ByteBuffer replicationMetadataPayload)
-
-
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
- Specified by:
getPosition
in interfacePubSubMessage<KafkaKey,
KafkaMessageEnvelope, PubSubPosition> - 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.
-
getPubSubMessageHeaders
- Specified by:
getPubSubMessageHeaders
in interfacePubSubMessage<KafkaKey,
KafkaMessageEnvelope, PubSubPosition>
-
getWriterSchemaId
public int getWriterSchemaId()- Specified by:
getWriterSchemaId
in interfacePubSubMessage<KafkaKey,
KafkaMessageEnvelope, PubSubPosition> - Returns:
- the schema id that the record was written with
-
getReplicationMetadataPayload
- Specified by:
getReplicationMetadataPayload
in interfacePubSubMessage<KafkaKey,
KafkaMessageEnvelope, PubSubPosition> - Returns:
- The serialized value of the replication metadata payload.
-
toString
-
getHeapSize
public int getHeapSize()- Specified by:
getHeapSize
in interfaceMeasurable
-