Package com.linkedin.venice.pubsub
Class ImmutablePubSubMessage<K,V>
- java.lang.Object
-
- com.linkedin.venice.pubsub.ImmutablePubSubMessage<K,V>
-
- All Implemented Interfaces:
Measurable
,PubSubMessage<K,V,java.lang.Long>
public class ImmutablePubSubMessage<K,V> extends java.lang.Object implements PubSubMessage<K,V,java.lang.Long>
-
-
Constructor Summary
Constructors Constructor Description ImmutablePubSubMessage(K key, V value, PubSubTopicPartition topicPartition, long offset, long timestamp, int payloadSize)
ImmutablePubSubMessage(K key, V value, PubSubTopicPartition topicPartition, long offset, long timestamp, int payloadSize, PubSubMessageHeaders pubSubMessageHeaders)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getHeapSize()
K
getKey()
java.lang.Long
getOffset()
int
getPayloadSize()
PubSubMessageHeaders
getPubSubMessageHeaders()
long
getPubSubMessageTime()
PubSubTopicPartition
getTopicPartition()
V
getValue()
boolean
isEndOfBootstrap()
java.lang.String
toString()
-
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
getPartition, getTopic, getTopicName
-
-
-
-
Constructor Detail
-
ImmutablePubSubMessage
public ImmutablePubSubMessage(K key, V value, PubSubTopicPartition topicPartition, long offset, long timestamp, int payloadSize)
-
ImmutablePubSubMessage
public ImmutablePubSubMessage(K key, V value, PubSubTopicPartition topicPartition, long offset, long timestamp, int payloadSize, PubSubMessageHeaders pubSubMessageHeaders)
-
-
Method Detail
-
getKey
public K getKey()
- Specified by:
getKey
in interfacePubSubMessage<K,V,java.lang.Long>
- Returns:
- the key part of this message
-
getValue
public V getValue()
- Specified by:
getValue
in interfacePubSubMessage<K,V,java.lang.Long>
- Returns:
- the value part of this message
-
getTopicPartition
public PubSubTopicPartition getTopicPartition()
- Specified by:
getTopicPartition
in interfacePubSubMessage<K,V,java.lang.Long>
- Returns:
- the topic-partition this message belongs to
-
getOffset
public java.lang.Long getOffset()
- Specified by:
getOffset
in interfacePubSubMessage<K,V,java.lang.Long>
- Returns:
- the offset of this message in the underlying topic-partition
-
getPubSubMessageTime
public long getPubSubMessageTime()
- Specified by:
getPubSubMessageTime
in interfacePubSubMessage<K,V,java.lang.Long>
- Returns:
- the timestamp at which the message was persisted in the pub sub system
-
getPayloadSize
public int getPayloadSize()
- Specified by:
getPayloadSize
in interfacePubSubMessage<K,V,java.lang.Long>
- Returns:
- the size in bytes of the key + value.
-
isEndOfBootstrap
public boolean isEndOfBootstrap()
- Specified by:
isEndOfBootstrap
in interfacePubSubMessage<K,V,java.lang.Long>
- Returns:
- whether this message marks the end of bootstrap.
-
getPubSubMessageHeaders
public PubSubMessageHeaders getPubSubMessageHeaders()
- Specified by:
getPubSubMessageHeaders
in interfacePubSubMessage<K,V,java.lang.Long>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getHeapSize
public int getHeapSize()
- Specified by:
getHeapSize
in interfaceMeasurable
-
-