Enum PayloadVersion

  • All Implemented Interfaces:
    Serializable, Comparable<PayloadVersion>, WritableObject

    @Beta
    public enum PayloadVersion
    extends Enum<PayloadVersion>
    implements 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.

    Author:
    Robert Varga
    • Enum Constant Detail

      • TEST_PAST_VERSION

        public static final PayloadVersion TEST_PAST_VERSION
        Version which is older than any other version. This version exists purely for testing purposes.
      • BORON

        public static final PayloadVersion BORON
        Initial ABI version, as shipped with Boron Simultaneous release.
      • TEST_FUTURE_VERSION

        public static final PayloadVersion TEST_FUTURE_VERSION
        Version which is newer than any other version. This version exists purely for testing purposes.
    • Method Detail

      • values

        public static PayloadVersion[] 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 (PayloadVersion c : PayloadVersion.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static PayloadVersion valueOf​(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:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - 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

        public abstract @NonNull NormalizedNodeStreamVersion getStreamVersion()
        Return the NormalizedNode stream version corresponding to this particular ABI.
        Returns:
        Stream Version to use for this ABI version
      • current

        public static @NonNull PayloadVersion 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