Enum ControlMessageType
- java.lang.Object
-
- java.lang.Enum<ControlMessageType>
-
- com.linkedin.venice.kafka.protocol.enums.ControlMessageType
-
- All Implemented Interfaces:
VeniceEnumValue
,java.io.Serializable
,java.lang.Comparable<ControlMessageType>
public enum ControlMessageType extends java.lang.Enum<ControlMessageType> implements VeniceEnumValue
A simple enum to map the values ofControlMessage.controlMessageType
N.B.: We maintain this enum manually because Avro's auto-generated enums do not support evolution (i.e.: adding values) properly.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description END_OF_INCREMENTAL_PUSH
END_OF_PUSH
END_OF_SEGMENT
START_OF_BUFFER_REPLAY
Deprecated.START_OF_INCREMENTAL_PUSH
START_OF_PUSH
START_OF_SEGMENT
TOPIC_SWITCH
VERSION_SWAP
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getNewInstance()
Simple utility function to generate the right type of control message, based on message type.int
getShallowClassOverhead()
int
getValue()
static ControlMessageType
valueOf(int value)
Returns the enum constant of this type with the specified name.static ControlMessageType
valueOf(ControlMessage controlMessage)
Returns the enum constant of this type with the specified name.static ControlMessageType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ControlMessageType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
START_OF_PUSH
public static final ControlMessageType START_OF_PUSH
-
END_OF_PUSH
public static final ControlMessageType END_OF_PUSH
-
START_OF_SEGMENT
public static final ControlMessageType START_OF_SEGMENT
-
END_OF_SEGMENT
public static final ControlMessageType END_OF_SEGMENT
-
START_OF_BUFFER_REPLAY
@Deprecated public static final ControlMessageType START_OF_BUFFER_REPLAY
Deprecated.
-
START_OF_INCREMENTAL_PUSH
public static final ControlMessageType START_OF_INCREMENTAL_PUSH
-
END_OF_INCREMENTAL_PUSH
public static final ControlMessageType END_OF_INCREMENTAL_PUSH
-
TOPIC_SWITCH
public static final ControlMessageType TOPIC_SWITCH
-
VERSION_SWAP
public static final ControlMessageType VERSION_SWAP
-
-
Method Detail
-
values
public static ControlMessageType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ControlMessageType c : ControlMessageType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ControlMessageType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getValue
public int getValue()
- Specified by:
getValue
in interfaceVeniceEnumValue
-
getNewInstance
public java.lang.Object getNewInstance()
Simple utility function to generate the right type of control message, based on message type.- Returns:
- an empty instance of either:
-
StartOfPush
-EndOfPush
-StartOfSegment
-EndOfSegment
-StartOfIncrementalPush
-EndOfIncrementalPush
-TopicSwitch
-VersionSwap
-
valueOf
public static ControlMessageType valueOf(int value)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
value
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
valueOf
public static ControlMessageType valueOf(ControlMessage controlMessage)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
controlMessage
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getShallowClassOverhead
public int getShallowClassOverhead()
-
-