/** * Sleep for period. */ public void sleep() { sleep(this.period); }
/** * If configured to put regions on active master, * wait till a backup master becomes active. * Otherwise, loop till the server is stopped or aborted. */ @Override protected void waitForMasterActive(){ if (maintenanceMode) { return; } boolean tablesOnMaster = LoadBalancer.isTablesOnMaster(conf); while (!(tablesOnMaster && activeMaster) && !isStopped() && !isAborted()) { sleeper.sleep(); } }
@Override public void run() { try { initialize(); while (!stopped) { this.sleeper.sleep(); } } catch (Exception e) { abort(e.getMessage(), e); } this.rpcServer.stop(); }
/** * Sleep for period. */ protected void sleep() { this.sleeper.sleep(); }
/** * Sleep for period. */ public void sleep() { sleep(this.period); }
private void loop() { while (!this.stopped) { stopSleeper.sleep(); } }
/** * Sleep for period. */ public void sleep() { sleep(System.currentTimeMillis()); }
/** * Sleep for period. */ public void sleep() { sleep(System.currentTimeMillis()); }
/** * Sleep for period. */ public void sleep() { sleep(System.currentTimeMillis()); }
private void loop() { long lastMsgTs = 0l; long now = 0l; while (!this.stopped) { now = System.currentTimeMillis(); if ((now - lastMsgTs) >= this.msgInterval) { doMetrics(); lastMsgTs = System.currentTimeMillis(); } stopSleeper.sleep(); } }
public void waitForServerOnline() { while (!isOnline() && !isStopped()) { sleeper.sleep(); } }
public void waitForServerOnline(){ while (!isOnline() && !isStopped()){ sleeper.sleep(); } }
/** * If configured to put regions on active master, * wait till a backup master becomes active. * Otherwise, loop till the server is stopped or aborted. */ @Override protected void waitForMasterActive(){ boolean tablesOnMaster = BaseLoadBalancer.tablesOnMaster(conf); while (!(tablesOnMaster && isActiveMaster) && !isStopped() && !isAborted()) { sleeper.sleep(); } }
previousLogTime = System.currentTimeMillis(); sleeper.sleep(); continue;
previousLogTime = System.currentTimeMillis(); sleeper.sleep(); continue;
/** * @see java.lang.Thread#run() */ @Override public void run() { try { boolean initialChoreComplete = false; while (!this.stopper.isStopped()) { long startTime = System.currentTimeMillis(); try { if (!initialChoreComplete) { initialChoreComplete = initialChore(); } else { chore(); } } catch (Exception e) { LOG.error("Caught exception", e); if (this.stopper.isStopped()) { continue; } } this.sleeper.sleep(startTime); } } catch (Throwable t) { LOG.fatal(getName() + "error", t); } finally { LOG.info(getName() + " exiting"); cleanup(); } }
@Override public void run() { try { initialize(); while (!stopped) { this.sleeper.sleep(); } } catch (Exception e) { abort(e.getMessage(), e); } this.rpcServer.stop(); }