Class ProducerPartitionState

java.lang.Object
org.apache.avro.specific.SpecificRecordBase
com.linkedin.venice.kafka.protocol.state.ProducerPartitionState
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 ProducerPartitionState extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord
A record containing the state pertaining to the data sent by one upstream producer into one partition.
See Also:
  • Field Details

    • SCHEMA$

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

      public int segmentNumber
      The current segment number corresponds to the last (highest) segment number for which we have seen a StartOfSegment control message.
    • segmentStatus

      public int segmentStatus
      The status of the current segment: 0 => NOT_STARTED, 1 => IN_PROGRESS, 2 => END_OF_INTERMEDIATE_SEGMENT, 3 => END_OF_FINAL_SEGMENT.
    • isRegistered

      public boolean isRegistered
      Whether the segment is registered. i.e. received Start_Of_Segment to initialize the segment.
    • messageSequenceNumber

      public int messageSequenceNumber
      The current message sequence number, within the current segment, which we have seen for this partition/producer pair.
    • messageTimestamp

      public long messageTimestamp
      The timestamp included in the last message we have seen for this partition/producer pair.
    • checksumType

      public int checksumType
      The current mapping is the following: 0 => None, 1 => MD5, 2 => Adler32, 3 => CRC32.
    • checksumState

      public ByteBuffer checksumState
      The value of the checksum computed since the last StartOfSegment ControlMessage.
    • aggregates

      public Map<CharSequence,Long> aggregates
      The aggregates that have been computed so far since the last StartOfSegment ControlMessage.
    • debugInfo

      public Map<CharSequence,CharSequence> debugInfo
      The debug info received as part of the last StartOfSegment ControlMessage.
  • Constructor Details

    • ProducerPartitionState

      public ProducerPartitionState()
      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().
    • ProducerPartitionState

      public ProducerPartitionState(Integer segmentNumber, Integer segmentStatus, Boolean isRegistered, Integer messageSequenceNumber, Long messageTimestamp, Integer checksumType, ByteBuffer checksumState, Map<CharSequence,Long> aggregates, Map<CharSequence,CharSequence> debugInfo)
      All-args constructor.
      Parameters:
      segmentNumber - The current segment number corresponds to the last (highest) segment number for which we have seen a StartOfSegment control message.
      segmentStatus - The status of the current segment: 0 => NOT_STARTED, 1 => IN_PROGRESS, 2 => END_OF_INTERMEDIATE_SEGMENT, 3 => END_OF_FINAL_SEGMENT.
      isRegistered - Whether the segment is registered. i.e. received Start_Of_Segment to initialize the segment.
      messageSequenceNumber - The current message sequence number, within the current segment, which we have seen for this partition/producer pair.
      messageTimestamp - The timestamp included in the last message we have seen for this partition/producer pair.
      checksumType - The current mapping is the following: 0 => None, 1 => MD5, 2 => Adler32, 3 => CRC32.
      checksumState - The value of the checksum computed since the last StartOfSegment ControlMessage.
      aggregates - The aggregates that have been computed so far since the last StartOfSegment ControlMessage.
      debugInfo - The debug info received as part of the last StartOfSegment ControlMessage.
  • 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
    • getSegmentNumber

      public int getSegmentNumber()
      Gets the value of the 'segmentNumber' field.
      Returns:
      The current segment number corresponds to the last (highest) segment number for which we have seen a StartOfSegment control message.
    • setSegmentNumber

      public void setSegmentNumber(int value)
      Sets the value of the 'segmentNumber' field. The current segment number corresponds to the last (highest) segment number for which we have seen a StartOfSegment control message.
      Parameters:
      value - the value to set.
    • getSegmentStatus

      public int getSegmentStatus()
      Gets the value of the 'segmentStatus' field.
      Returns:
      The status of the current segment: 0 => NOT_STARTED, 1 => IN_PROGRESS, 2 => END_OF_INTERMEDIATE_SEGMENT, 3 => END_OF_FINAL_SEGMENT.
    • setSegmentStatus

      public void setSegmentStatus(int value)
      Sets the value of the 'segmentStatus' field. The status of the current segment: 0 => NOT_STARTED, 1 => IN_PROGRESS, 2 => END_OF_INTERMEDIATE_SEGMENT, 3 => END_OF_FINAL_SEGMENT.
      Parameters:
      value - the value to set.
    • getIsRegistered

      public boolean getIsRegistered()
      Gets the value of the 'isRegistered' field.
      Returns:
      Whether the segment is registered. i.e. received Start_Of_Segment to initialize the segment.
    • setIsRegistered

      public void setIsRegistered(boolean value)
      Sets the value of the 'isRegistered' field. Whether the segment is registered. i.e. received Start_Of_Segment to initialize the segment.
      Parameters:
      value - the value to set.
    • getMessageSequenceNumber

      public int getMessageSequenceNumber()
      Gets the value of the 'messageSequenceNumber' field.
      Returns:
      The current message sequence number, within the current segment, which we have seen for this partition/producer pair.
    • setMessageSequenceNumber

      public void setMessageSequenceNumber(int value)
      Sets the value of the 'messageSequenceNumber' field. The current message sequence number, within the current segment, which we have seen for this partition/producer pair.
      Parameters:
      value - the value to set.
    • getMessageTimestamp

      public long getMessageTimestamp()
      Gets the value of the 'messageTimestamp' field.
      Returns:
      The timestamp included in the last message we have seen for this partition/producer pair.
    • setMessageTimestamp

      public void setMessageTimestamp(long value)
      Sets the value of the 'messageTimestamp' field. The timestamp included in the last message we have seen for this partition/producer pair.
      Parameters:
      value - the value to set.
    • getChecksumType

      public int getChecksumType()
      Gets the value of the 'checksumType' field.
      Returns:
      The current mapping is the following: 0 => None, 1 => MD5, 2 => Adler32, 3 => CRC32.
    • setChecksumType

      public void setChecksumType(int value)
      Sets the value of the 'checksumType' field. The current mapping is the following: 0 => None, 1 => MD5, 2 => Adler32, 3 => CRC32.
      Parameters:
      value - the value to set.
    • getChecksumState

      public ByteBuffer getChecksumState()
      Gets the value of the 'checksumState' field.
      Returns:
      The value of the checksum computed since the last StartOfSegment ControlMessage.
    • setChecksumState

      public void setChecksumState(ByteBuffer value)
      Sets the value of the 'checksumState' field. The value of the checksum computed since the last StartOfSegment ControlMessage.
      Parameters:
      value - the value to set.
    • getAggregates

      public Map<CharSequence,Long> getAggregates()
      Gets the value of the 'aggregates' field.
      Returns:
      The aggregates that have been computed so far since the last StartOfSegment ControlMessage.
    • setAggregates

      public void setAggregates(Map<CharSequence,Long> value)
      Sets the value of the 'aggregates' field. The aggregates that have been computed so far since the last StartOfSegment ControlMessage.
      Parameters:
      value - the value to set.
    • getDebugInfo

      public Map<CharSequence,CharSequence> getDebugInfo()
      Gets the value of the 'debugInfo' field.
      Returns:
      The debug info received as part of the last StartOfSegment ControlMessage.
    • setDebugInfo

      public void setDebugInfo(Map<CharSequence,CharSequence> value)
      Sets the value of the 'debugInfo' field. The debug info received as part of the last StartOfSegment ControlMessage.
      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