Class MotorState

java.lang.Object
io.nosqlbench.engine.api.activityimpl.MotorState
All Implemented Interfaces:
Supplier<RunState>

public class MotorState extends Object implements Supplier<RunState>
Holds the state of a slot, allows only valid transitions, and shares the slot state as
  • Constructor Details

    • MotorState

      public MotorState(long slotId, RunStateTally tally)
  • Method Details

    • get

      public RunState get()
      Specified by:
      get in interface Supplier<RunState>
    • getAtomicSlotState

      public AtomicReference<RunState> 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

      public void enterState(RunState to)

      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
    • removeState

      public void removeState()