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
FieldsModifier and TypeFieldDescriptionintUsing 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
ConstructorsConstructorDescriptionDefault constructor.ControlMessage(Integer controlMessageType, Map<CharSequence, CharSequence> debugInfo, Object controlMessageUnion) All-args constructor. -
Method Summary
Modifier and TypeMethodDescriptionget(int field$) static org.apache.avro.SchemaintGets the value of the 'controlMessageType' field.Gets the value of the 'controlMessageUnion' field.Gets the value of the 'debugInfo' field.org.apache.avro.Schemaorg.apache.avro.specific.SpecificDatavoidvoidvoidsetControlMessageType(int value) Sets the value of the 'controlMessageType' field.voidsetControlMessageUnion(Object value) Sets the value of the 'controlMessageUnion' field.voidsetDebugInfo(Map<CharSequence, CharSequence> value) Sets the value of the 'debugInfo' 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$ -
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:
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
-
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:
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
-