Package com.linkedin.venice.pubsub.api
Class PubSubMessageHeaders
- java.lang.Object
-
- com.linkedin.venice.pubsub.api.PubSubMessageHeaders
-
- All Implemented Interfaces:
Measurable
,java.lang.Iterable<PubSubMessageHeader>
- Direct Known Subclasses:
EmptyPubSubMessageHeaders
public class PubSubMessageHeaders extends java.lang.Object implements Measurable, java.lang.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 Modifier and Type Field Description static java.lang.String
VENICE_LEADER_COMPLETION_STATE_HEADER
Header to denote whether the leader is completed or notstatic java.lang.String
VENICE_TRANSPORT_PROTOCOL_HEADER
-
Constructor Summary
Constructors Constructor Description PubSubMessageHeaders()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PubSubMessageHeaders
add(PubSubMessageHeader header)
PubSubMessageHeaders
add(java.lang.String key, byte[] value)
int
getHeapSize()
boolean
isEmpty()
java.util.Iterator<PubSubMessageHeader>
iterator()
PubSubMessageHeaders
remove(java.lang.String key)
java.util.List<PubSubMessageHeader>
toList()
-
-
-
Field Detail
-
VENICE_TRANSPORT_PROTOCOL_HEADER
public static final java.lang.String VENICE_TRANSPORT_PROTOCOL_HEADER
- See Also:
- Constant Field Values
-
VENICE_LEADER_COMPLETION_STATE_HEADER
public static final java.lang.String VENICE_LEADER_COMPLETION_STATE_HEADER
Header to denote whether the leader is completed or not- See Also:
- Constant Field Values
-
-
Method Detail
-
add
public PubSubMessageHeaders add(PubSubMessageHeader header)
-
add
public PubSubMessageHeaders add(java.lang.String key, byte[] value)
-
remove
public PubSubMessageHeaders remove(java.lang.String key)
-
toList
public java.util.List<PubSubMessageHeader> 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
public java.util.Iterator<PubSubMessageHeader> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<PubSubMessageHeader>
-
-