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
Modifier and TypeFieldDescriptionlong
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
-
Method Summary
Modifier and TypeMethodDescriptionget
(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
void
void
setLogicalTimestamp
(long value) Sets the value of the 'logicalTimestamp' field.void
setMessageSequenceNumber
(int value) Sets the value of the 'messageSequenceNumber' field.void
setMessageTimestamp
(long value) Sets the value of the 'messageTimestamp' field.void
setProducerGUID
(GUID value) 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
A unique identifier for this producer. -
segmentNumber
public int segmentNumberA 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 messageSequenceNumberA 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 messageTimestampThe 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 logicalTimestampThis 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 usenewBuilder()
. -
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 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
-
getProducerGUID
Gets the value of the 'producerGUID' field.- Returns:
- A unique identifier for this producer.
-
setProducerGUID
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
- 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
-