Class SlotStateTracker
java.lang.Object
io.nosqlbench.engine.api.activityimpl.SlotStateTracker
public class SlotStateTracker
extends java.lang.Object
Holds the state of a slot, allows only valid transitions, and shares the
slot state as
-
Constructor Summary
Constructors Constructor Description SlotStateTracker(long slotId) -
Method Summary
Modifier and Type Method Description voidenterState(RunState to)Transition the thread slot to a new state.java.util.concurrent.atomic.AtomicReference<RunState>getAtomicSlotState()This is how you share the current slot state most directly, but it has a caveat.RunStategetSlotState()
-
Constructor Details
-
SlotStateTracker
public SlotStateTracker(long slotId)
-
-
Method Details
-
getSlotState
-
getAtomicSlotState
This is how you share the current slot state most directly, but it has a caveat. By sharing the slot state in this way, you allow external changes. You should only use this method to share slot state for observers.- Returns:
- an atomic reference for SlotState
-
enterState
Transition the thread slot to a new state. only accepting valid transitions.
The valid slot states will be moved to a data type eventually, simplifying this method.
- Parameters:
to- The next SlotState for this thread/slot/motor
-