Record Class CosIdProperties.Leased
java.lang.Object
java.lang.Record
me.ahoo.cosid.spring.autoconfigure.CosIdProperties.Leased
- Record Components:
store- the store namebits- the slots are[0, 2^bits); default 10ttl- the lease time to live; default 30stolerance- the window ceiling lies this far beyond the expiry (D20); default 1sacquireTimeout- how long the start waits for a slot while every slot is held (D42); default the ttlslotOffset- 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 usedpreferredSlot- the slot to try first, such as a StatefulSet ordinal; empty for noneownerKey- the owner key;host:portorhost:pidwhen 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theacquireTimeoutrecord component.intbits()Returns the value of thebitsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.ownerKey()Returns the value of theownerKeyrecord component.Returns the value of thepreferredSlotrecord component.intReturns the value of theslotOffsetrecord component.store()Returns the value of thestorerecord component.Returns the value of thetolerancerecord component.final StringtoString()Returns a string representation of this record class.ttl()Returns the value of thettlrecord component.
-
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 aLeasedrecord class.- Parameters:
store- the value for thestorerecord componentbits- the value for thebitsrecord componentttl- the value for thettlrecord componenttolerance- the value for thetolerancerecord componentacquireTimeout- the value for theacquireTimeoutrecord componentslotOffset- the value for theslotOffsetrecord componentpreferredSlot- the value for thepreferredSlotrecord componentownerKey- the value for theownerKeyrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
store
Returns the value of thestorerecord component.- Returns:
- the value of the
storerecord component
-
bits
public int bits()Returns the value of thebitsrecord component.- Returns:
- the value of the
bitsrecord component
-
ttl
Returns the value of thettlrecord component.- Returns:
- the value of the
ttlrecord component
-
tolerance
Returns the value of thetolerancerecord component.- Returns:
- the value of the
tolerancerecord component
-
acquireTimeout
Returns the value of theacquireTimeoutrecord component.- Returns:
- the value of the
acquireTimeoutrecord component
-
slotOffset
public int slotOffset()Returns the value of theslotOffsetrecord component.- Returns:
- the value of the
slotOffsetrecord component
-
preferredSlot
Returns the value of thepreferredSlotrecord component.- Returns:
- the value of the
preferredSlotrecord component
-
ownerKey
Returns the value of theownerKeyrecord component.- Returns:
- the value of the
ownerKeyrecord component
-