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 Summary
FieldsModifier and TypeFieldDescriptionThe aggregates that have been computed so far since the last StartOfSegment ControlMessage.The value of the checksum computed since the last StartOfSegment ControlMessage.intThe current mapping is the following: 0 => None, 1 => MD5, 2 => Adler32, 3 => CRC32.The debug info received as part of the last StartOfSegment ControlMessage.booleanWhether the segment is registered.intThe current message sequence number, within the current segment, which we have seen for this partition/producer pair.longThe timestamp included in the last message we have seen for this partition/producer pair.static final org.apache.avro.SchemaintThe current segment number corresponds to the last (highest) segment number for which we have seen a StartOfSegment control message.intThe status of the current segment: 0 => NOT_STARTED, 1 => IN_PROGRESS, 2 => END_OF_INTERMEDIATE_SEGMENT, 3 => END_OF_FINAL_SEGMENT. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.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. -
Method Summary
Modifier and TypeMethodDescriptionget(int field$) Gets the value of the 'aggregates' field.Gets the value of the 'checksumState' field.intGets the value of the 'checksumType' field.static org.apache.avro.SchemaGets the value of the 'debugInfo' field.booleanGets the value of the 'isRegistered' field.intGets the value of the 'messageSequenceNumber' field.longGets the value of the 'messageTimestamp' field.org.apache.avro.SchemaintGets the value of the 'segmentNumber' field.intGets the value of the 'segmentStatus' field.org.apache.avro.specific.SpecificDatavoidvoidvoidsetAggregates(Map<CharSequence, Long> value) Sets the value of the 'aggregates' field.voidsetChecksumState(ByteBuffer value) Sets the value of the 'checksumState' field.voidsetChecksumType(int value) Sets the value of the 'checksumType' field.voidsetDebugInfo(Map<CharSequence, CharSequence> value) Sets the value of the 'debugInfo' field.voidsetIsRegistered(boolean value) Sets the value of the 'isRegistered' field.voidsetMessageSequenceNumber(int value) Sets the value of the 'messageSequenceNumber' field.voidsetMessageTimestamp(long value) Sets the value of the 'messageTimestamp' field.voidsetSegmentNumber(int value) Sets the value of the 'segmentNumber' field.voidsetSegmentStatus(int value) Sets the value of the 'segmentStatus' field.voidMethods inherited from class org.apache.avro.specific.SpecificRecordBase
compareTo, customDecode, customEncode, equals, get, getConversion, getConversion, hasCustomCoders, hashCode, put, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.avro.generic.GenericRecord
hasField
-
Field Details
-
SCHEMA$
public static final org.apache.avro.Schema SCHEMA$ -
segmentNumber
public int segmentNumberThe current segment number corresponds to the last (highest) segment number for which we have seen a StartOfSegment control message. -
segmentStatus
public int segmentStatusThe status of the current segment: 0 => NOT_STARTED, 1 => IN_PROGRESS, 2 => END_OF_INTERMEDIATE_SEGMENT, 3 => END_OF_FINAL_SEGMENT. -
isRegistered
public boolean isRegisteredWhether the segment is registered. i.e. received Start_Of_Segment to initialize the segment. -
messageSequenceNumber
public int messageSequenceNumberThe current message sequence number, within the current segment, which we have seen for this partition/producer pair. -
messageTimestamp
public long messageTimestampThe timestamp included in the last message we have seen for this partition/producer pair. -
checksumType
public int checksumTypeThe 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.
-
-
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 usenewBuilder(). -
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:
getSpecificDatain classorg.apache.avro.specific.SpecificRecordBase
-
getSchema
public org.apache.avro.Schema getSchema()- Specified by:
getSchemain interfaceorg.apache.avro.generic.GenericContainer- Specified by:
getSchemain classorg.apache.avro.specific.SpecificRecordBase
-
get
- Specified by:
getin interfaceorg.apache.avro.generic.IndexedRecord- Specified by:
getin classorg.apache.avro.specific.SpecificRecordBase
-
put
- Specified by:
putin interfaceorg.apache.avro.generic.IndexedRecord- Specified by:
putin classorg.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
Gets the value of the 'checksumState' field.- Returns:
- The value of the checksum computed since the last StartOfSegment ControlMessage.
-
setChecksumState
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
Gets the value of the 'aggregates' field.- Returns:
- The aggregates that have been computed so far since the last StartOfSegment ControlMessage.
-
setAggregates
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
Gets the value of the 'debugInfo' field.- Returns:
- The debug info received as part of the last StartOfSegment ControlMessage.
-
setDebugInfo
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
- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classorg.apache.avro.specific.SpecificRecordBase- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classorg.apache.avro.specific.SpecificRecordBase- Throws:
IOException
-