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
FieldsModifier and TypeFieldDescriptionlongThis timestamp may be specified by the user.intA monotonically increasing number with no gaps used to distinguish unique messages produced in this segment (i.e.: by this producer into a given partition).longThe 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.SchemaintA number used to disambiguate between sequential segments sent into a given partition by a given producer. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget(int field$) static org.apache.avro.SchemalongGets the value of the 'logicalTimestamp' field.intGets the value of the 'messageSequenceNumber' field.longGets the value of the 'messageTimestamp' field.Gets the value of the 'producerGUID' field.org.apache.avro.SchemaintGets the value of the 'segmentNumber' field.org.apache.avro.specific.SpecificDatavoidvoidvoidsetLogicalTimestamp(long value) Sets the value of the 'logicalTimestamp' field.voidsetMessageSequenceNumber(int value) Sets the value of the 'messageSequenceNumber' field.voidsetMessageTimestamp(long value) Sets the value of the 'messageTimestamp' field.voidsetProducerGUID(GUID value) Sets the value of the 'producerGUID' field.voidsetSegmentNumber(int value) Sets the value of the 'segmentNumber' 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$ -
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:
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
-
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:
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
-