Class Sleeper

java.lang.Object
org.apache.hadoop.hbase.util.Sleeper

@Private public class Sleeper extends Object
Sleeper for current thread. Sleeps for passed period. Also checks passed boolean and if interrupted, will return if the flag is set (rather than go back to sleep until its sleep time is up).
  • Field Details

  • Constructor Details

    • Sleeper

      public Sleeper(int sleep, Stoppable stopper)
      Parameters:
      sleep - sleep time in milliseconds
      stopper - When Stoppable.isStopped() is true, this thread will cleanup and exit cleanly.
  • Method Details

    • skipSleepCycle

      public void skipSleepCycle()
      If currently asleep, stops sleeping; if not asleep, will skip the next sleep cycle.
    • sleep

      public void sleep()
      Sleep for period.
    • sleep

      public void sleep(long sleepTime)
    • getPeriod

      public final int getPeriod()
      Returns the sleep period in milliseconds