Package org.apache.hadoop.hbase.util
Class Sleeper
java.lang.Object
org.apache.hadoop.hbase.util.Sleeper
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 Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
LOG
-
period
-
stopper
-
MINIMAL_DELTA_FOR_LOGGING
- See Also:
-
sleepLock
-
triggerWake
-
-
Constructor Details
-
Sleeper
- Parameters:
sleep
- sleep time in millisecondsstopper
- WhenStoppable.isStopped()
is true, this thread will cleanup and exit cleanly.
-
-
Method Details
-
skipSleepCycle
If currently asleep, stops sleeping; if not asleep, will skip the next sleep cycle. -
sleep
Sleep for period. -
sleep
-
getPeriod
Returns the sleep period in milliseconds
-