this.msgInterval = conf.getInt("hbase.regionserver.msginterval", 3 * 1000); this.sleeper = new Sleeper(this.msgInterval, this);
this.sleeper = new Sleeper(1000, this);
/** * @param p Period at which we should run. Will be adjusted appropriately * should we find work and it takes time to complete. * @param stopper When {@link Stoppable#isStopped()} is true, this thread will * cleanup and exit cleanly. */ public Chore(String name, final int p, final Stoppable stopper) { super(name); this.sleeper = new Sleeper(p, stopper); this.stopper = stopper; }
@Test public void testSnooze() throws Exception { Thread t = new Thread(new Sleeper()); t.start(); t.join(); }
public class ProcessMain { public static void main(String[] args) { for(int i = 0 ; i<4; i++){ new Thread(new StackOverflowPinger(i)).run(); new Thread(new Sleeper(i)).run(); } } }
this.sleeper = new Sleeper(this.msgInterval, this);
this.msgInterval = conf.getInt("hbase.regionserver.msginterval", 3 * 1000); this.sleeper = new Sleeper(this.msgInterval, this);
retryTemplate.setRetryPolicy(retryPolicy); Sleeper sleeper = new Sleeper() { private long timeToSleep = 0; @Override
this.sleeper = new Sleeper(1000, this);
this.msgInterval = conf.getInt("hbase.regionserver.msginterval", 3 * 1000); this.sleeper = new Sleeper(this.msgInterval, this);