java.lang.Object
me.ahoo.cosid.runtime.MachineSpec.Leased.Builder
- Enclosing class:
MachineSpec.Leased
Builds a
MachineSpec.Leased.-
Method Summary
Modifier and TypeMethodDescriptionacquireTimeout(Duration acquireTimeout) Sets how longCosIdRuntime.startwaits for a slot while every slot is held (D42).bits(int bits) Sets the slot bits.build()Builds the leased slot.Sets the namespace of the slot leases (D37).Sets the owner key.preferredSlot(int preferredSlot) Sets the slot to try first, such as a StatefulSet ordinal.slotOffset(int slotOffset) Sets the offset added to the slot to give the node of the ids (api-freeze.md §2.1.1); it never changes once used, and every client of the namespace uses the same one.Sets how far beyond the expiry the ceiling lies (D20).Sets the lease time to live.
-
Method Details
-
bits
Sets the slot bits.- Parameters:
bits- the slots are[0, 2^bits); default 10- Returns:
- this builder
-
ttl
Sets the lease time to live.- Parameters:
ttl- the ttl; default 30s- Returns:
- this builder
-
tolerance
Sets how far beyond the expiry the ceiling lies (D20).- Parameters:
tolerance- the tolerance; default 1s- Returns:
- this builder
-
acquireTimeout
Sets how longCosIdRuntime.startwaits for a slot while every slot is held (D42).- Parameters:
acquireTimeout- the timeout, not negative;Duration.ZEROtries once; default the ttl- Returns:
- this builder
-
slotOffset
Sets the offset added to the slot to give the node of the ids (api-freeze.md §2.1.1); it never changes once used, and every client of the namespace uses the same one.- Parameters:
slotOffset- the offset, not negative; default 0- Returns:
- this builder
-
preferredSlot
Sets the slot to try first, such as a StatefulSet ordinal.- Parameters:
preferredSlot- the slot; default none- Returns:
- this builder
-
ownerKey
Sets the owner key.- Parameters:
ownerKey- the owner key; derived as in 07 §1.1 by default- Returns:
- this builder
-
namespace
Sets the namespace of the slot leases (D37).- Parameters:
namespace- the namespace; default theRuntimeSpec.namespace()- Returns:
- this builder
-
build
Builds the leased slot.- Returns:
- the leased slot
-