java.lang.Object
me.ahoo.cosid.lease.SlotBinding
One holding of a slot and its time window (05-machine-lease.md ยง4.1). A renewal raises
ceiling() in place;
a new acquisition publishes a new binding with the next generation(); a lost lease invalidates the binding.
Generators keep their sequencer state per binding, so it resets with every new binding.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongceiling()longfloor()longvoidMarks the binding lost: generators reading it throwSlotLostException.booleanisValid()voidraiseCeiling(long newCeiling) Raises the ceiling after a renewal; a lower value is ignored, the ceiling never goes down.intslot()
-
Constructor Details
-
SlotBinding
public SlotBinding(int slot, long floor, long ceiling, long generation) A binding.- Parameters:
slot- the slotfloor- timestamps must be strictly above it, in millisecondsceiling- timestamps must be at most it, in millisecondsgeneration- counts the bindings of aSlotHandle
-
-
Method Details
-
slot
public int slot() -
floor
public long floor() -
ceiling
public long ceiling() -
generation
public long generation() -
isValid
public boolean isValid() -
raiseCeiling
public void raiseCeiling(long newCeiling) Raises the ceiling after a renewal; a lower value is ignored, the ceiling never goes down.- Parameters:
newCeiling- the renewed ceiling
-
invalidate
public void invalidate()Marks the binding lost: generators reading it throwSlotLostException.
-