org.apache.hadoop.hbase.util
Class Sleeper

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

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).


Constructor Summary
Sleeper(int sleep, AtomicBoolean stop)
           
 
Method Summary
 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

Sleeper

public Sleeper(int sleep,
               AtomicBoolean stop)
Parameters:
sleep -
stop -
Method Detail

sleep

public void sleep()
Sleep for period.


sleep

public void sleep(long startTime)
Sleep for period adjusted by passed startTime

Parameters:
startTime - Time some task started previous to now. Time to sleep will be docked current time minus passed startTime.


Copyright © 2006 The Apache Software Foundation