Class ProducerMetadata
- java.lang.Object
-
- org.apache.avro.specific.SpecificRecordBase
-
- com.linkedin.venice.kafka.protocol.ProducerMetadata
-
- 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 ProducerMetadata extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description long
logicalTimestamp
This timestamp may be specified by the user.int
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).long
messageTimestamp
The time of the producer's local system clock, at the time the message was submitted for production.GUID
producerGUID
A unique identifier for this producer.static org.apache.avro.Schema
SCHEMA$
int
segmentNumber
A number used to disambiguate between sequential segments sent into a given partition by a given producer.
-
Constructor Summary
Constructors Constructor Description ProducerMetadata()
Default constructor.ProducerMetadata(GUID producerGUID, java.lang.Integer segmentNumber, java.lang.Integer messageSequenceNumber, java.lang.Long messageTimestamp, java.lang.Long logicalTimestamp)
All-args constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
get(int field$)
static org.apache.avro.Schema
getClassSchema()
long
getLogicalTimestamp()
Gets the value of the 'logicalTimestamp' field.int
getMessageSequenceNumber()
Gets the value of the 'messageSequenceNumber' field.long
getMessageTimestamp()
Gets the value of the 'messageTimestamp' field.GUID
getProducerGUID()
Gets the value of the 'producerGUID' field.org.apache.avro.Schema
getSchema()
int
getSegmentNumber()
Gets the value of the 'segmentNumber' field.org.apache.avro.specific.SpecificData
getSpecificData()
void
put(int field$, java.lang.Object value$)
void
readExternal(java.io.ObjectInput in)
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
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
-
-
-
-
Field Detail
-
SCHEMA$
public static final org.apache.avro.Schema SCHEMA$
-
producerGUID
public GUID producerGUID
A unique identifier for this producer.
-
segmentNumber
public int 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
public int 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
public long 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
public long 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.
-
-
Constructor Detail
-
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, java.lang.Integer segmentNumber, java.lang.Integer messageSequenceNumber, java.lang.Long messageTimestamp, java.lang.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 Detail
-
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
public java.lang.Object get(int field$)
- Specified by:
get
in interfaceorg.apache.avro.generic.IndexedRecord
- Specified by:
get
in classorg.apache.avro.specific.SpecificRecordBase
-
put
public void put(int field$, java.lang.Object value$)
- Specified by:
put
in interfaceorg.apache.avro.generic.IndexedRecord
- Specified by:
put
in classorg.apache.avro.specific.SpecificRecordBase
-
getProducerGUID
public GUID getProducerGUID()
Gets the value of the 'producerGUID' field.- Returns:
- A unique identifier for this producer.
-
setProducerGUID
public void setProducerGUID(GUID value)
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
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Overrides:
writeExternal
in classorg.apache.avro.specific.SpecificRecordBase
- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException
- Specified by:
readExternal
in interfacejava.io.Externalizable
- Overrides:
readExternal
in classorg.apache.avro.specific.SpecificRecordBase
- Throws:
java.io.IOException
-
-