Class LeaderMetadataWrapper

java.lang.Object
com.linkedin.venice.writer.LeaderMetadataWrapper

public class LeaderMetadataWrapper extends Object
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 Details

    • DEFAULT_UPSTREAM_MESSAGE_TIMESTAMP

      public static final long DEFAULT_UPSTREAM_MESSAGE_TIMESTAMP
      Sentinel 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. Pass DEFAULT_UPSTREAM_MESSAGE_TIMESTAMP when no upstream timestamp is available, and null when no view-partition map is needed.
  • Method Details

    • getUpstreamPosition

      public PubSubPosition getUpstreamPosition()
    • getUpstreamKafkaClusterId

      public int getUpstreamKafkaClusterId()
    • getViewPartitionMap

      public Map<String,Set<Integer>> 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 of ProducerMetadata.messageTimestamp). Returns DEFAULT_UPSTREAM_MESSAGE_TIMESTAMP when no upstream message is available.