Class ControlMessage
- java.lang.Object
-
- org.apache.avro.specific.SpecificRecordBase
-
- com.linkedin.venice.kafka.protocol.ControlMessage
-
- 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 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description int
controlMessageType
Using int because Avro Enums are not evolvable.java.lang.Object
controlMessageUnion
This contains the ControlMessage data which is specific to each type of ControlMessage.java.util.Map<java.lang.CharSequence,java.lang.CharSequence>
debugInfo
This metadata is for logging and traceability purposes.static org.apache.avro.Schema
SCHEMA$
-
Constructor Summary
Constructors Constructor Description ControlMessage()
Default constructor.ControlMessage(java.lang.Integer controlMessageType, java.util.Map<java.lang.CharSequence,java.lang.CharSequence> debugInfo, java.lang.Object controlMessageUnion)
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()
int
getControlMessageType()
Gets the value of the 'controlMessageType' field.java.lang.Object
getControlMessageUnion()
Gets the value of the 'controlMessageUnion' field.java.util.Map<java.lang.CharSequence,java.lang.CharSequence>
getDebugInfo()
Gets the value of the 'debugInfo' field.org.apache.avro.Schema
getSchema()
org.apache.avro.specific.SpecificData
getSpecificData()
void
put(int field$, java.lang.Object value$)
void
readExternal(java.io.ObjectInput in)
void
setControlMessageType(int value)
Sets the value of the 'controlMessageType' field.void
setControlMessageUnion(java.lang.Object value)
Sets the value of the 'controlMessageUnion' field.void
setDebugInfo(java.util.Map<java.lang.CharSequence,java.lang.CharSequence> value)
Sets the value of the 'debugInfo' 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$
-
controlMessageType
public int 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 => VersionSwap
-
debugInfo
public java.util.Map<java.lang.CharSequence,java.lang.CharSequence> 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
public java.lang.Object 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 Detail
-
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(java.lang.Integer controlMessageType, java.util.Map<java.lang.CharSequence,java.lang.CharSequence> debugInfo, java.lang.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 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
-
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
public java.util.Map<java.lang.CharSequence,java.lang.CharSequence> 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
public void setDebugInfo(java.util.Map<java.lang.CharSequence,java.lang.CharSequence> value)
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
public java.lang.Object 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
public void setControlMessageUnion(java.lang.Object value)
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
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
-
-