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
Modifier 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.int
The current mapping is the following: 0 => None, 1 => MD5, 2 => Adler32, 3 => CRC32.The debug info received as part of the last StartOfSegment ControlMessage.boolean
Whether the segment is registered.int
The current message sequence number, within the current segment, which we have seen for this partition/producer pair.long
The timestamp included in the last message we have seen for this partition/producer pair.static final org.apache.avro.Schema
int
The current segment number corresponds to the last (highest) segment number for which we have seen a StartOfSegment control message.int
The status of the current segment: 0 => NOT_STARTED, 1 => IN_PROGRESS, 2 => END_OF_INTERMEDIATE_SEGMENT, 3 => END_OF_FINAL_SEGMENT. -
Constructor Summary
ConstructorDescriptionDefault 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.int
Gets the value of the 'checksumType' field.static org.apache.avro.Schema
Gets the value of the 'debugInfo' field.boolean
Gets the value of the 'isRegistered' field.int
Gets the value of the 'messageSequenceNumber' field.long
Gets the value of the 'messageTimestamp' field.org.apache.avro.Schema
int
Gets the value of the 'segmentNumber' field.int
Gets the value of the 'segmentStatus' field.org.apache.avro.specific.SpecificData
void
void
void
setAggregates
(Map<CharSequence, Long> value) Sets the value of the 'aggregates' field.void
setChecksumState
(ByteBuffer value) Sets the value of the 'checksumState' field.void
setChecksumType
(int value) Sets the value of the 'checksumType' field.void
setDebugInfo
(Map<CharSequence, 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
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$ -
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:
getSpecificData
in classorg.apache.avro.specific.SpecificRecordBase
-
getSchema
public org.apache.avro.Schema getSchema()- Specified by:
getSchema
in interfaceorg.apache.avro.generic.GenericContainer
- Specified by:
getSchema
in classorg.apache.avro.specific.SpecificRecordBase
-
get
- Specified by:
get
in interfaceorg.apache.avro.generic.IndexedRecord
- Specified by:
get
in classorg.apache.avro.specific.SpecificRecordBase
-
put
- Specified by:
put
in interfaceorg.apache.avro.generic.IndexedRecord
- Specified by:
put
in 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:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classorg.apache.avro.specific.SpecificRecordBase
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classorg.apache.avro.specific.SpecificRecordBase
- Throws:
IOException
-