Class ControlMessage
java.lang.Object
org.apache.avro.specific.SpecificRecordBase
com.linkedin.venice.kafka.protocol.ControlMessage
- 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 ControlMessage
extends org.apache.avro.specific.SpecificRecordBase
implements org.apache.avro.specific.SpecificRecord
ControlMessage payloads contain metadata about the stream of data, for validation and debuggability purposes.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionint
Using int because Avro Enums are not evolvable.This contains the ControlMessage data which is specific to each type of ControlMessage.This metadata is for logging and traceability purposes.static final org.apache.avro.Schema
-
Constructor Summary
ConstructorDescriptionDefault constructor.ControlMessage
(Integer controlMessageType, Map<CharSequence, CharSequence> debugInfo, Object controlMessageUnion) All-args constructor. -
Method Summary
Modifier and TypeMethodDescriptionget
(int field$) static org.apache.avro.Schema
int
Gets the value of the 'controlMessageType' field.Gets the value of the 'controlMessageUnion' field.Gets the value of the 'debugInfo' field.org.apache.avro.Schema
org.apache.avro.specific.SpecificData
void
void
void
setControlMessageType
(int value) Sets the value of the 'controlMessageType' field.void
setControlMessageUnion
(Object value) Sets the value of the 'controlMessageUnion' field.void
setDebugInfo
(Map<CharSequence, CharSequence> value) Sets the value of the 'debugInfo' 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$ -
controlMessageType
public int controlMessageTypeUsing int because Avro Enums are not evolvable. Readers should always handle the 'unknown' value edge case, to account for future evolutions of this protocol. The mapping is the following: 0 => StartOfPush, 1 => EndOfPush, 2 => StartOfSegment, 3 => EndOfSegment, 4 => StartOfBufferReplay (Deprecated), 5 => StartOfIncrementalPush, 6 => EndOfIncrementalPush, 7 => TopicSwitch, 8 => VersionSwap -
debugInfo
This metadata is for logging and traceability purposes. It can be used to propagate information about the producer, the environment it runs in, or the source of data being produced into Venice. There should be no assumptions that any of this data will be used (or even looked at) by the downstream consumer in any particular way. -
controlMessageUnion
This contains the ControlMessage data which is specific to each type of ControlMessage. Which branch of the union is present is based on the previously-defined MessageType field.
-
-
Constructor Details
-
ControlMessage
public ControlMessage()Default constructor. Note that this does not initialize fields to their default values from the schema. If that is desired then one should usenewBuilder()
. -
ControlMessage
public ControlMessage(Integer controlMessageType, Map<CharSequence, CharSequence> debugInfo, Object controlMessageUnion) All-args constructor.- Parameters:
controlMessageType
- Using int because Avro Enums are not evolvable. Readers should always handle the 'unknown' value edge case, to account for future evolutions of this protocol. The mapping is the following: 0 => StartOfPush, 1 => EndOfPush, 2 => StartOfSegment, 3 => EndOfSegment, 4 => StartOfBufferReplay (Deprecated), 5 => StartOfIncrementalPush, 6 => EndOfIncrementalPush, 7 => TopicSwitch, 8 => VersionSwapdebugInfo
- This metadata is for logging and traceability purposes. It can be used to propagate information about the producer, the environment it runs in, or the source of data being produced into Venice. There should be no assumptions that any of this data will be used (or even looked at) by the downstream consumer in any particular way.controlMessageUnion
- This contains the ControlMessage data which is specific to each type of ControlMessage. Which branch of the union is present is based on the previously-defined MessageType field.
-
-
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
-
getControlMessageType
public int getControlMessageType()Gets the value of the 'controlMessageType' field.- Returns:
- Using int because Avro Enums are not evolvable. Readers should always handle the 'unknown' value edge case, to account for future evolutions of this protocol. The mapping is the following: 0 => StartOfPush, 1 => EndOfPush, 2 => StartOfSegment, 3 => EndOfSegment, 4 => StartOfBufferReplay (Deprecated), 5 => StartOfIncrementalPush, 6 => EndOfIncrementalPush, 7 => TopicSwitch, 8 => VersionSwap
-
setControlMessageType
public void setControlMessageType(int value) Sets the value of the 'controlMessageType' field. Using int because Avro Enums are not evolvable. Readers should always handle the 'unknown' value edge case, to account for future evolutions of this protocol. The mapping is the following: 0 => StartOfPush, 1 => EndOfPush, 2 => StartOfSegment, 3 => EndOfSegment, 4 => StartOfBufferReplay (Deprecated), 5 => StartOfIncrementalPush, 6 => EndOfIncrementalPush, 7 => TopicSwitch, 8 => VersionSwap- Parameters:
value
- the value to set.
-
getDebugInfo
Gets the value of the 'debugInfo' field.- Returns:
- This metadata is for logging and traceability purposes. It can be used to propagate information about the producer, the environment it runs in, or the source of data being produced into Venice. There should be no assumptions that any of this data will be used (or even looked at) by the downstream consumer in any particular way.
-
setDebugInfo
Sets the value of the 'debugInfo' field. This metadata is for logging and traceability purposes. It can be used to propagate information about the producer, the environment it runs in, or the source of data being produced into Venice. There should be no assumptions that any of this data will be used (or even looked at) by the downstream consumer in any particular way.- Parameters:
value
- the value to set.
-
getControlMessageUnion
Gets the value of the 'controlMessageUnion' field.- Returns:
- This contains the ControlMessage data which is specific to each type of ControlMessage. Which branch of the union is present is based on the previously-defined MessageType field.
-
setControlMessageUnion
Sets the value of the 'controlMessageUnion' field. This contains the ControlMessage data which is specific to each type of ControlMessage. Which branch of the union is present is based on the previously-defined MessageType field.- 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
-