java.lang.Object
me.ahoo.cosid.lease.SlotLease.Builder
- Enclosing class:
SlotLease
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the lease.ceiling(long ceiling) Sets the ceiling: the holder issues timestamps up to it, inclusive.expiresAt(long expiresAt) Sets when others may take the slot over.fence(long fence) Sets the fence.floor(long floor) Sets the floor: the holder issues timestamps strictly above it.Sets the namespace; required.Sets the holder; required.slot(int slot) Sets the slot.storeNow(long storeNow) Sets the store clock of the write that produced the lease.
-
Method Details
-
namespace
Sets the namespace; required.- Parameters:
namespace- the namespace- Returns:
- this builder
-
slot
Sets the slot.- Parameters:
slot- the slot, not negative- Returns:
- this builder
-
owner
Sets the holder; required.- Parameters:
owner- the owner- Returns:
- this builder
-
fence
Sets the fence.- Parameters:
fence- the fence- Returns:
- this builder
-
expiresAt
Sets when others may take the slot over.- Parameters:
expiresAt- the expiry- Returns:
- this builder
-
floor
Sets the floor: the holder issues timestamps strictly above it.- Parameters:
floor- the floor- Returns:
- this builder
-
ceiling
Sets the ceiling: the holder issues timestamps up to it, inclusive.- Parameters:
ceiling- the ceiling, not below the floor- Returns:
- this builder
-
storeNow
Sets the store clock of the write that produced the lease.- Parameters:
storeNow- the store time- Returns:
- this builder
-
build
Builds the lease.- Returns:
- the lease
- Throws:
NullPointerException- if the namespace or the owner is not setIllegalArgumentException- if the slot is negative or the ceiling is below the floor
-