java.lang.Object
me.ahoo.cosid.lease.SlotLease
A lease of a time window
(floor, ceiling] on a slot (05-machine-lease.md §2). Times are store-clock
milliseconds since the Unix epoch. Immutable; built with builder(), the only way to create one, so fields
can be added with a default (api-freeze.md §4); toBuilder() derives one.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds aSlotLease;SlotLease.Builder.build()checks the fields. -
Method Summary
Modifier and TypeMethodDescriptionstatic SlotLease.Builderbuilder()A builder of a lease; the namespace and the owner are required, the numbers default to 0.longceiling()The holder issues timestamps up to it, inclusive.booleanlongWhen others may take the slot over.longfence()Raised on every ownership change (acquire, takeover, release); unchanged by renewals.longfloor()The holder issues timestamps strictly above it.inthashCode()The namespace.owner()The holder.intslot()The slot, in[0, limit).longstoreNow()The store clock of the write that produced this lease.A builder holding this lease, to derive another.toString()
-
Method Details
-
builder
A builder of a lease; the namespace and the owner are required, the numbers default to 0.- Returns:
- the builder
-
toBuilder
A builder holding this lease, to derive another.- Returns:
- the builder
-
namespace
The namespace.- Returns:
- the namespace
-
slot
public int slot()The slot, in[0, limit).- Returns:
- the slot
-
owner
The holder.- Returns:
- the owner
-
fence
public long fence()Raised on every ownership change (acquire, takeover, release); unchanged by renewals.- Returns:
- the fence
-
expiresAt
public long expiresAt()When others may take the slot over.- Returns:
- the expiry
-
floor
public long floor()The holder issues timestamps strictly above it.- Returns:
- the floor
-
ceiling
public long ceiling()The holder issues timestamps up to it, inclusive.- Returns:
- the ceiling
-
storeNow
public long storeNow()The store clock of the write that produced this lease.- Returns:
- the store time
-
equals
-
hashCode
public int hashCode() -
toString
-