|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.util.Sleeper
@InterfaceAudience.Private public class 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).
Constructor Summary | |
---|---|
Sleeper(int sleep,
Stoppable stopper)
|
Method Summary | |
---|---|
void |
skipSleepCycle()
If currently asleep, stops sleeping; if not asleep, will skip the next sleep cycle. |
void |
sleep()
Sleep for period. |
void |
sleep(long startTime)
Sleep for period adjusted by passed startTime |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Sleeper(int sleep, Stoppable stopper)
sleep
- sleep time in millisecondsstopper
- When Stoppable.isStopped()
is true, this thread will
cleanup and exit cleanly.Method Detail |
---|
public void sleep()
public void skipSleepCycle()
public void sleep(long startTime)
startTime
- Parameters:
startTime
- Time some task started previous to now. Time to sleep
will be docked current time minus passed startTime.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |