* @pdOid f0a6ab43-8cd3-44e1-8fd3-015a2ec51c6a
*/
public void waitForWorkerLaunch(Map conf, String workerId, int startTime)
throws IOException, InterruptedException {
LocalState ls = StormConfig.worker_state(conf, workerId);
while (true) {
WorkerHeartbeat whb = (WorkerHeartbeat) ls
.get(Common.LS_WORKER_HEARTBEAT);
if (whb == null
&& ((TimeUtils.current_time_secs() - startTime) < (Integer) conf
.get(Config.SUPERVISOR_WORKER_START_TIMEOUT_SECS))) {
LOG.info(workerId + "still hasn't started");
Time.sleep(500);
} else {
// whb is valid or timeout
break;
}
}
WorkerHeartbeat whb = (WorkerHeartbeat) ls
.get(Common.LS_WORKER_HEARTBEAT);
if (whb == null) {
LOG.info("Worker " + workerId + "failed to start");
}
}