Package com.linkedin.venice.pubsub.api
Class PubSubMessageHeaders
java.lang.Object
com.linkedin.venice.pubsub.api.PubSubMessageHeaders
- All Implemented Interfaces:
Measurable
,Iterable<PubSubMessageHeader>
- Direct Known Subclasses:
EmptyPubSubMessageHeaders
public class PubSubMessageHeaders
extends Object
implements Measurable, Iterable<PubSubMessageHeader>
Set of key-value pairs to tagged with messages produced to a topic.
In case of headers with the same key, only the most recently added headers value will be kept.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd
(PubSubMessageHeader header) int
boolean
isEmpty()
iterator()
toList()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
VENICE_TRANSPORT_PROTOCOL_HEADER
- See Also:
-
VENICE_LEADER_COMPLETION_STATE_HEADER
Header to denote whether the leader is completed or not- See Also:
-
VENICE_VIEW_PARTITIONS_MAP_HEADER
Header to provide the desired view partition mapping for the given message. Example usage: 1. A VPJ containing large messages write chunks with the header {"view1":[0], "view2":[1, 2]}. Partition leaders during NR pass-through in remote fabrics can forward chunks to their destination view partition(s) without any further processing. In the example, this chunk should be sent to view1's partition 0 and view2's partitions 1 & 2.- See Also:
-
-
Constructor Details
-
PubSubMessageHeaders
public PubSubMessageHeaders()
-
-
Method Details
-
add
-
add
-
remove
-
get
-
toList
- Returns:
- the headers as a List
. Mutating this list will not affect the PubSubMessageHeaders. If no headers are present an empty list is returned.
-
isEmpty
public boolean isEmpty() -
getHeapSize
public int getHeapSize()- Specified by:
getHeapSize
in interfaceMeasurable
-
iterator
- Specified by:
iterator
in interfaceIterable<PubSubMessageHeader>
-