Class ProducerPartitionState

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable, java.lang.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:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.Map<java.lang.CharSequence,​java.lang.Long> aggregates
      The aggregates that have been computed so far since the last StartOfSegment ControlMessage.
      java.nio.ByteBuffer checksumState
      The value of the checksum computed since the last StartOfSegment ControlMessage.
      int checksumType
      The current mapping is the following: 0 => None, 1 => MD5, 2 => Adler32, 3 => CRC32.
      java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> debugInfo
      The debug info received as part of the last StartOfSegment ControlMessage.
      boolean isRegistered
      Whether the segment is registered.
      int messageSequenceNumber
      The current message sequence number, within the current segment, which we have seen for this partition/producer pair.
      long messageTimestamp
      The timestamp included in the last message we have seen for this partition/producer pair.
      static org.apache.avro.Schema SCHEMA$  
      int segmentNumber
      The current segment number corresponds to the last (highest) segment number for which we have seen a StartOfSegment control message.
      int segmentStatus
      The status of the current segment: 0 => NOT_STARTED, 1 => IN_PROGRESS, 2 => END_OF_INTERMEDIATE_SEGMENT, 3 => END_OF_FINAL_SEGMENT.
    • Constructor Summary

      Constructors 
      Constructor Description
      ProducerPartitionState()
      Default constructor.
      ProducerPartitionState​(java.lang.Integer segmentNumber, java.lang.Integer segmentStatus, java.lang.Boolean isRegistered, java.lang.Integer messageSequenceNumber, java.lang.Long messageTimestamp, java.lang.Integer checksumType, java.nio.ByteBuffer checksumState, java.util.Map<java.lang.CharSequence,​java.lang.Long> aggregates, java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> debugInfo)
      All-args constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object get​(int field$)  
      java.util.Map<java.lang.CharSequence,​java.lang.Long> getAggregates()
      Gets the value of the 'aggregates' field.
      java.nio.ByteBuffer getChecksumState()
      Gets the value of the 'checksumState' field.
      int getChecksumType()
      Gets the value of the 'checksumType' field.
      static org.apache.avro.Schema getClassSchema()  
      java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> getDebugInfo()
      Gets the value of the 'debugInfo' field.
      boolean getIsRegistered()
      Gets the value of the 'isRegistered' field.
      int getMessageSequenceNumber()
      Gets the value of the 'messageSequenceNumber' field.
      long getMessageTimestamp()
      Gets the value of the 'messageTimestamp' field.
      org.apache.avro.Schema getSchema()  
      int getSegmentNumber()
      Gets the value of the 'segmentNumber' field.
      int getSegmentStatus()
      Gets the value of the 'segmentStatus' field.
      org.apache.avro.specific.SpecificData getSpecificData()  
      void put​(int field$, java.lang.Object value$)  
      void readExternal​(java.io.ObjectInput in)  
      void setAggregates​(java.util.Map<java.lang.CharSequence,​java.lang.Long> value)
      Sets the value of the 'aggregates' field.
      void setChecksumState​(java.nio.ByteBuffer value)
      Sets the value of the 'checksumState' field.
      void setChecksumType​(int value)
      Sets the value of the 'checksumType' field.
      void setDebugInfo​(java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> value)
      Sets the value of the 'debugInfo' field.
      void setIsRegistered​(boolean value)
      Sets the value of the 'isRegistered' field.
      void setMessageSequenceNumber​(int value)
      Sets the value of the 'messageSequenceNumber' field.
      void setMessageTimestamp​(long value)
      Sets the value of the 'messageTimestamp' field.
      void setSegmentNumber​(int value)
      Sets the value of the 'segmentNumber' field.
      void setSegmentStatus​(int value)
      Sets the value of the 'segmentStatus' field.
      void writeExternal​(java.io.ObjectOutput out)  
      • 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 Detail

      • 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 java.nio.ByteBuffer checksumState
        The value of the checksum computed since the last StartOfSegment ControlMessage.
      • aggregates

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

        public java.util.Map<java.lang.CharSequence,​java.lang.CharSequence> debugInfo
        The debug info received as part of the last StartOfSegment ControlMessage.
    • Constructor Detail

      • 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​(java.lang.Integer segmentNumber,
                                      java.lang.Integer segmentStatus,
                                      java.lang.Boolean isRegistered,
                                      java.lang.Integer messageSequenceNumber,
                                      java.lang.Long messageTimestamp,
                                      java.lang.Integer checksumType,
                                      java.nio.ByteBuffer checksumState,
                                      java.util.Map<java.lang.CharSequence,​java.lang.Long> aggregates,
                                      java.util.Map<java.lang.CharSequence,​java.lang.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 Detail

      • 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 java.lang.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$,
                        java.lang.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 java.nio.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​(java.nio.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 java.util.Map<java.lang.CharSequence,​java.lang.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​(java.util.Map<java.lang.CharSequence,​java.lang.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 java.util.Map<java.lang.CharSequence,​java.lang.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​(java.util.Map<java.lang.CharSequence,​java.lang.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​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Overrides:
        writeExternal in class org.apache.avro.specific.SpecificRecordBase
        Throws:
        java.io.IOException
      • readExternal

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