Package com.linkedin.venice.writer
Class LeaderMetadataWrapper
java.lang.Object
com.linkedin.venice.writer.LeaderMetadataWrapper
This is a simple container class to hold Leader metadata related fields together to be passed on to the Put and Delete api in VeniceWriter
Caller should construct an instance of this object by properly filling up all the fields of this object.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longSentinel value indicating that no upstream message timestamp is available for the produced record (e.g., self-generated records that do not originate from a consumed upstream message). -
Constructor Summary
ConstructorsConstructorDescriptionLeaderMetadataWrapper(PubSubPosition upstreamPosition, int upstreamKafkaClusterId, long termId) Backward-compatible 3-arg constructor for call sites that don't carry an upstream message timestamp or a view-partition map.LeaderMetadataWrapper(PubSubPosition upstreamPosition, int upstreamKafkaClusterId, long termId, long upstreamMessageTimestamp, Map<String, Set<Integer>> viewPartitionMap) Canonical constructor. -
Method Summary
Modifier and TypeMethodDescriptionlongintlongThe timestamp of the upstream message from which the leader produced this record, expressed as milliseconds since the Unix epoch (matching the time basis ofProducerMetadata.messageTimestamp).
-
Field Details
-
DEFAULT_UPSTREAM_MESSAGE_TIMESTAMP
public static final long DEFAULT_UPSTREAM_MESSAGE_TIMESTAMPSentinel value indicating that no upstream message timestamp is available for the produced record (e.g., self-generated records that do not originate from a consumed upstream message).- See Also:
-
-
Constructor Details
-
LeaderMetadataWrapper
public LeaderMetadataWrapper(PubSubPosition upstreamPosition, int upstreamKafkaClusterId, long termId) Backward-compatible 3-arg constructor for call sites that don't carry an upstream message timestamp or a view-partition map. Defaults both to their sentinel/null. -
LeaderMetadataWrapper
public LeaderMetadataWrapper(PubSubPosition upstreamPosition, int upstreamKafkaClusterId, long termId, long upstreamMessageTimestamp, Map<String, Set<Integer>> viewPartitionMap) Canonical constructor. PassDEFAULT_UPSTREAM_MESSAGE_TIMESTAMPwhen no upstream timestamp is available, andnullwhen no view-partition map is needed.
-
-
Method Details
-
getUpstreamPosition
-
getUpstreamKafkaClusterId
public int getUpstreamKafkaClusterId() -
getViewPartitionMap
-
getTermId
public long getTermId() -
getUpstreamMessageTimestamp
public long getUpstreamMessageTimestamp()The timestamp of the upstream message from which the leader produced this record, expressed as milliseconds since the Unix epoch (matching the time basis ofProducerMetadata.messageTimestamp). ReturnsDEFAULT_UPSTREAM_MESSAGE_TIMESTAMPwhen no upstream message is available.
-