Enum Class PayloadVersion
java.lang.Object
java.lang.Enum<PayloadVersion>
org.opendaylight.controller.cluster.datastore.persisted.PayloadVersion
- All Implemented Interfaces:
Serializable,Comparable<PayloadVersion>,Constable,WritableObject
Enumeration of all ABI versions supported by this implementation of persistence. An ABI version has to be bumped
whenever:
- a new event is defined
- serialization format is changed
This version effectively defines the protocol version between actors participating on a particular shard. A shard participant instance should oppose RAFT candidates which produce persistence of an unsupported version. If a follower encounters an unsupported version it must not become fully-operational, as it does not have an accurate view of shard state.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionABI version shipped enabled2023.09 Potassium.Version which is newer than any other version.Version which is older than any other version. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull PayloadVersioncurrent()Return the codebase-native persistence version.abstract @NonNull NormalizedNodeStreamVersionReturn the NormalizedNode stream version corresponding to this particular ABI.static @NonNull PayloadVersionRead anPayloadVersionfrom aDataInput.shortReturn the unsigned short integer identifying this version.static @NonNull PayloadVersionvalueOf(short version) Return thePayloadVersioncorresponding to an unsigned short integer.static PayloadVersionReturns the enum constant of this class with the specified name.static PayloadVersion[]values()Returns an array containing the constants of this enum class, in the order they are declared.voidwriteTo(DataOutput out)
-
Enum Constant Details
-
TEST_PAST_VERSION
Version which is older than any other version. This version exists purely for testing purposes. -
POTASSIUM
ABI version shipped enabled2023.09 Potassium. -
TEST_FUTURE_VERSION
Version which is newer than any other version. This version exists purely for testing purposes.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
shortValue
public short shortValue()Return the unsigned short integer identifying this version.- Returns:
- Unsigned short integer identifying this version
-
getStreamVersion
Return the NormalizedNode stream version corresponding to this particular ABI.- Returns:
- Stream Version to use for this ABI version
-
current
Return the codebase-native persistence version. This version is the default version allocated to messages at runtime. Conversion to previous versions may incur additional overhead (such as object allocation).- Returns:
- Current
PayloadVersion
-
valueOf
public static @NonNull PayloadVersion valueOf(short version) throws FutureVersionException, PastVersionException Return thePayloadVersioncorresponding to an unsigned short integer. This method is provided for callers which provide their own recovery strategy in case of version incompatibility.- Parameters:
version- Short integer as returned fromshortValue()- Returns:
PayloadVersion- Throws:
FutureVersionException- if the specified integer identifies a future versionPastVersionException- if the specified integer identifies a past version which is no longer supported
-
writeTo
- Specified by:
writeToin interfaceWritableObject- Throws:
IOException
-
readFrom
Read anPayloadVersionfrom aDataInput. This method is provided for callers which do not have a recovery strategy for dealing with unsupported versions.- Parameters:
in- Input from which to read- Returns:
- An
PayloadVersion - Throws:
IOException- If read fails or an unsupported version is encountered
-