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) < JStormUtils
.parseInt(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.error("Failed to start Worker " + workerId);
} else {
LOG.info("Successfully start worker " + workerId);