Record Class CosIdProperties.Leased

java.lang.Object
java.lang.Record
me.ahoo.cosid.spring.autoconfigure.CosIdProperties.Leased
Record Components:
store - the store name
bits - the slots are [0, 2^bits); default 10
ttl - the lease time to live; default 30s
tolerance - the window ceiling lies this far beyond the expiry (D20); default 1s
acquireTimeout - how long the start waits for a slot while every slot is held (D42); default the ttl
slotOffset - added to the slot to give the node of the ids, apart from 4.x machine ids during a rolling migration; default 0, never changed once used
preferredSlot - the slot to try first, such as a StatefulSet ordinal; empty for none
ownerKey - the owner key; host:port or host:pid when empty (07 ยง1.1)
Enclosing class:
CosIdProperties

public static record CosIdProperties.Leased(String store, int bits, Duration ttl, Duration tolerance, Duration acquireTimeout, int slotOffset, Integer preferredSlot, String ownerKey) extends Record
A slot leased from a store.
  • Constructor Details

    • Leased

      public Leased(String store, @DefaultValue("10") int bits, @DefaultValue("30s") Duration ttl, @DefaultValue("1s") Duration tolerance, Duration acquireTimeout, @DefaultValue("0") int slotOffset, Integer preferredSlot, String ownerKey)
      Creates an instance of a Leased record class.
      Parameters:
      store - the value for the store record component
      bits - the value for the bits record component
      ttl - the value for the ttl record component
      tolerance - the value for the tolerance record component
      acquireTimeout - the value for the acquireTimeout record component
      slotOffset - the value for the slotOffset record component
      preferredSlot - the value for the preferredSlot record component
      ownerKey - the value for the ownerKey record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • store

      public String store()
      Returns the value of the store record component.
      Returns:
      the value of the store record component
    • bits

      public int bits()
      Returns the value of the bits record component.
      Returns:
      the value of the bits record component
    • ttl

      public Duration ttl()
      Returns the value of the ttl record component.
      Returns:
      the value of the ttl record component
    • tolerance

      public Duration tolerance()
      Returns the value of the tolerance record component.
      Returns:
      the value of the tolerance record component
    • acquireTimeout

      public Duration acquireTimeout()
      Returns the value of the acquireTimeout record component.
      Returns:
      the value of the acquireTimeout record component
    • slotOffset

      public int slotOffset()
      Returns the value of the slotOffset record component.
      Returns:
      the value of the slotOffset record component
    • preferredSlot

      public Integer preferredSlot()
      Returns the value of the preferredSlot record component.
      Returns:
      the value of the preferredSlot record component
    • ownerKey

      public String ownerKey()
      Returns the value of the ownerKey record component.
      Returns:
      the value of the ownerKey record component