Class ProducerMetadata

java.lang.Object
org.apache.avro.specific.SpecificRecordBase
com.linkedin.venice.kafka.protocol.ProducerMetadata
All Implemented Interfaces:
Externalizable, Serializable, Comparable<org.apache.avro.specific.SpecificRecord>, org.apache.avro.generic.GenericContainer, org.apache.avro.generic.GenericRecord, org.apache.avro.generic.IndexedRecord, org.apache.avro.specific.SpecificRecord

public class ProducerMetadata extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    long
    This timestamp may be specified by the user.
    int
    A monotonically increasing number with no gaps used to distinguish unique messages produced in this segment (i.e.: by this producer into a given partition).
    long
    The time of the producer's local system clock, at the time the message was submitted for production.
    A unique identifier for this producer.
    static final org.apache.avro.Schema
     
    int
    A number used to disambiguate between sequential segments sent into a given partition by a given producer.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
    ProducerMetadata(GUID producerGUID, Integer segmentNumber, Integer messageSequenceNumber, Long messageTimestamp, Long logicalTimestamp)
    All-args constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    get(int field$)
     
    static org.apache.avro.Schema
     
    long
    Gets the value of the 'logicalTimestamp' field.
    int
    Gets the value of the 'messageSequenceNumber' field.
    long
    Gets the value of the 'messageTimestamp' field.
    Gets the value of the 'producerGUID' field.
    org.apache.avro.Schema
     
    int
    Gets the value of the 'segmentNumber' field.
    org.apache.avro.specific.SpecificData
     
    void
    put(int field$, Object value$)
     
    void
     
    void
    setLogicalTimestamp(long value)
    Sets the value of the 'logicalTimestamp' field.
    void
    Sets the value of the 'messageSequenceNumber' field.
    void
    setMessageTimestamp(long value)
    Sets the value of the 'messageTimestamp' field.
    void
    Sets the value of the 'producerGUID' field.
    void
    setSegmentNumber(int value)
    Sets the value of the 'segmentNumber' field.
    void
     

    Methods inherited from class org.apache.avro.specific.SpecificRecordBase

    compareTo, customDecode, customEncode, equals, get, getConversion, getConversion, hasCustomCoders, hashCode, put, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.avro.generic.GenericRecord

    hasField
  • Field Details

    • SCHEMA$

      public static final org.apache.avro.Schema SCHEMA$
    • producerGUID

      public GUID producerGUID
      A unique identifier for this producer.
    • segmentNumber

      public int segmentNumber
      A number used to disambiguate between sequential segments sent into a given partition by a given producer. An incremented SegmentNumber should only be sent following an EndOfSegment control message. For finite streams (such as those bulk-loaded from Hadoop), it can be acceptable to have a single SegmentNumber per producer/partition combination, though that is not something that the downstream consumer should assume. For infinite streams, segments should be terminated and begun anew periodically. This number begins at 0.
    • messageSequenceNumber

      public int messageSequenceNumber
      A monotonically increasing number with no gaps used to distinguish unique messages produced in this segment (i.e.: by this producer into a given partition). This number begins at 0 (with a StartOfSegment ControlMessage) and subsequent messages (such as Put) will have a SequenceNumber of 1 and so forth.
    • messageTimestamp

      public long messageTimestamp
      The time of the producer's local system clock, at the time the message was submitted for production. This is the number of milliseconds from the unix epoch, 1 January 1970 00:00:00.000 UTC.
    • logicalTimestamp

      public long logicalTimestamp
      This timestamp may be specified by the user. Sentinel value of -1 => apps are not using latest lib, -2 => apps have not specified the time. In case of negative values messageTimestamp field will be used for replication metadata.
  • Constructor Details

    • ProducerMetadata

      public ProducerMetadata()
      Default constructor. Note that this does not initialize fields to their default values from the schema. If that is desired then one should use newBuilder().
    • ProducerMetadata

      public ProducerMetadata(GUID producerGUID, Integer segmentNumber, Integer messageSequenceNumber, Long messageTimestamp, Long logicalTimestamp)
      All-args constructor.
      Parameters:
      producerGUID - A unique identifier for this producer.
      segmentNumber - A number used to disambiguate between sequential segments sent into a given partition by a given producer. An incremented SegmentNumber should only be sent following an EndOfSegment control message. For finite streams (such as those bulk-loaded from Hadoop), it can be acceptable to have a single SegmentNumber per producer/partition combination, though that is not something that the downstream consumer should assume. For infinite streams, segments should be terminated and begun anew periodically. This number begins at 0.
      messageSequenceNumber - A monotonically increasing number with no gaps used to distinguish unique messages produced in this segment (i.e.: by this producer into a given partition). This number begins at 0 (with a StartOfSegment ControlMessage) and subsequent messages (such as Put) will have a SequenceNumber of 1 and so forth.
      messageTimestamp - The time of the producer's local system clock, at the time the message was submitted for production. This is the number of milliseconds from the unix epoch, 1 January 1970 00:00:00.000 UTC.
      logicalTimestamp - This timestamp may be specified by the user. Sentinel value of -1 => apps are not using latest lib, -2 => apps have not specified the time. In case of negative values messageTimestamp field will be used for replication metadata.
  • Method Details

    • getClassSchema

      public static org.apache.avro.Schema getClassSchema()
    • getSpecificData

      public org.apache.avro.specific.SpecificData getSpecificData()
      Overrides:
      getSpecificData in class org.apache.avro.specific.SpecificRecordBase
    • getSchema

      public org.apache.avro.Schema getSchema()
      Specified by:
      getSchema in interface org.apache.avro.generic.GenericContainer
      Specified by:
      getSchema in class org.apache.avro.specific.SpecificRecordBase
    • get

      public Object get(int field$)
      Specified by:
      get in interface org.apache.avro.generic.IndexedRecord
      Specified by:
      get in class org.apache.avro.specific.SpecificRecordBase
    • put

      public void put(int field$, Object value$)
      Specified by:
      put in interface org.apache.avro.generic.IndexedRecord
      Specified by:
      put in class org.apache.avro.specific.SpecificRecordBase
    • getProducerGUID

      public GUID getProducerGUID()
      Gets the value of the 'producerGUID' field.
      Returns:
      A unique identifier for this producer.
    • setProducerGUID

      public void setProducerGUID(GUID value)
      Sets the value of the 'producerGUID' field. A unique identifier for this producer.
      Parameters:
      value - the value to set.
    • getSegmentNumber

      public int getSegmentNumber()
      Gets the value of the 'segmentNumber' field.
      Returns:
      A number used to disambiguate between sequential segments sent into a given partition by a given producer. An incremented SegmentNumber should only be sent following an EndOfSegment control message. For finite streams (such as those bulk-loaded from Hadoop), it can be acceptable to have a single SegmentNumber per producer/partition combination, though that is not something that the downstream consumer should assume. For infinite streams, segments should be terminated and begun anew periodically. This number begins at 0.
    • setSegmentNumber

      public void setSegmentNumber(int value)
      Sets the value of the 'segmentNumber' field. A number used to disambiguate between sequential segments sent into a given partition by a given producer. An incremented SegmentNumber should only be sent following an EndOfSegment control message. For finite streams (such as those bulk-loaded from Hadoop), it can be acceptable to have a single SegmentNumber per producer/partition combination, though that is not something that the downstream consumer should assume. For infinite streams, segments should be terminated and begun anew periodically. This number begins at 0.
      Parameters:
      value - the value to set.
    • getMessageSequenceNumber

      public int getMessageSequenceNumber()
      Gets the value of the 'messageSequenceNumber' field.
      Returns:
      A monotonically increasing number with no gaps used to distinguish unique messages produced in this segment (i.e.: by this producer into a given partition). This number begins at 0 (with a StartOfSegment ControlMessage) and subsequent messages (such as Put) will have a SequenceNumber of 1 and so forth.
    • setMessageSequenceNumber

      public void setMessageSequenceNumber(int value)
      Sets the value of the 'messageSequenceNumber' field. A monotonically increasing number with no gaps used to distinguish unique messages produced in this segment (i.e.: by this producer into a given partition). This number begins at 0 (with a StartOfSegment ControlMessage) and subsequent messages (such as Put) will have a SequenceNumber of 1 and so forth.
      Parameters:
      value - the value to set.
    • getMessageTimestamp

      public long getMessageTimestamp()
      Gets the value of the 'messageTimestamp' field.
      Returns:
      The time of the producer's local system clock, at the time the message was submitted for production. This is the number of milliseconds from the unix epoch, 1 January 1970 00:00:00.000 UTC.
    • setMessageTimestamp

      public void setMessageTimestamp(long value)
      Sets the value of the 'messageTimestamp' field. The time of the producer's local system clock, at the time the message was submitted for production. This is the number of milliseconds from the unix epoch, 1 January 1970 00:00:00.000 UTC.
      Parameters:
      value - the value to set.
    • getLogicalTimestamp

      public long getLogicalTimestamp()
      Gets the value of the 'logicalTimestamp' field.
      Returns:
      This timestamp may be specified by the user. Sentinel value of -1 => apps are not using latest lib, -2 => apps have not specified the time. In case of negative values messageTimestamp field will be used for replication metadata.
    • setLogicalTimestamp

      public void setLogicalTimestamp(long value)
      Sets the value of the 'logicalTimestamp' field. This timestamp may be specified by the user. Sentinel value of -1 => apps are not using latest lib, -2 => apps have not specified the time. In case of negative values messageTimestamp field will be used for replication metadata.
      Parameters:
      value - the value to set.
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Overrides:
      writeExternal in class org.apache.avro.specific.SpecificRecordBase
      Throws:
      IOException
    • readExternal

      public void readExternal(ObjectInput in) throws IOException
      Specified by:
      readExternal in interface Externalizable
      Overrides:
      readExternal in class org.apache.avro.specific.SpecificRecordBase
      Throws:
      IOException