Class MachineSpec.Static

java.lang.Object
me.ahoo.cosid.runtime.MachineSpec.Static
All Implemented Interfaces:
MachineSpec
Enclosing interface:
MachineSpec

public static final class MachineSpec.Static extends Object implements MachineSpec
A slot the user keeps unique, with a local window file.
  • Method Details

    • builder

      public static MachineSpec.Static.Builder builder(int slot)
      A builder of a static slot.
      Parameters:
      slot - the slot
      Returns:
      the builder
    • bits

      public int bits()
      The slot bits.
      Specified by:
      bits in interface MachineSpec
      Returns:
      the slot bits; default 10
    • slot

      public int slot()
      The slot.
      Returns:
      the slot
    • stateFile

      public Optional<Path> stateFile()
      The window file; none means no clock regression protection.
      Returns:
      the window file; default none
    • ahead

      public Duration ahead()
      How far ahead the ceiling is written.
      Returns:
      the distance; default 10s
    • notBefore

      public Optional<Instant> notBefore()
      The floor when the file does not exist yet (given by the migration tool).
      Returns:
      the floor; default none
    • namespace

      public Optional<String> namespace()
      Description copied from interface: MachineSpec
      The namespace of the slot leases (D37): a machine shared by several services, such as the slot of a cosid80 generator unique across them, names its own; every machine of a runtime has another namespace.
      Specified by:
      namespace in interface MachineSpec
      Returns:
      the namespace; empty for the RuntimeSpec.namespace()
    • withNamespace

      public MachineSpec.Static withNamespace(String namespace)
      This machine in another namespace.
      Parameters:
      namespace - the namespace
      Returns:
      the machine
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object