Enum ReplicatedRegister.Clock

Object
Enum<ReplicatedRegister.Clock>
kalix.javasdk.replicatedentity.ReplicatedRegister.Clock
All Implemented Interfaces:
Serializable, Comparable<ReplicatedRegister.Clock>
Enclosing interface:
ReplicatedRegister<T>

public static enum ReplicatedRegister.Clock extends Enum<ReplicatedRegister.Clock>
Clock for register replication
  • Enum Constant Details

    • DEFAULT

      public static final ReplicatedRegister.Clock DEFAULT
      The default clock, uses the current system time as the clock value.
    • REVERSE

      public static final ReplicatedRegister.Clock REVERSE
      A reverse clock, based on the system clock.

      Using this effectively achieves First-Write-Wins semantics.

      This is susceptible to the same clock skew problems as the default clock.

    • CUSTOM

      public static final ReplicatedRegister.Clock CUSTOM
      A custom clock.

      The custom clock value is passed by using the customClockValue parameter on the ReplicatedRegister.set(Object, Clock, long) method. The value should be a domain specific monotonically increasing value. For example, if the source of the value for this register is a single device, that device may attach a sequence number to each update, that sequence number can be used to guarantee that the register will converge to the last update emitted by that device.

    • CUSTOM_AUTO_INCREMENT

      public static final ReplicatedRegister.Clock CUSTOM_AUTO_INCREMENT
      A custom clock, that automatically increments the custom value if the local clock value is greater than it.

      This is like CUSTOM, however if when performing the update in the proxy, it's found that the clock value of the register is greater than the specified clock value for the update, the proxy will instead use the current clock value of the register plus one.

      This can guarantee that updates done on the same node will be causally ordered (addressing problems caused by the system clock being adjusted), but will not guarantee causal ordering for updates on different nodes, since it's possible that an update on a different node has not yet been replicated to this node.

  • Method Details

    • values

      public static ReplicatedRegister.Clock[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ReplicatedRegister.Clock 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