if ( proc.isComplete() ) {
logger.debug(methodName, j.getId(), "Skipping process", pid, "on", ni.getName(), "beacause state is", state);
continue;
}
Machine m = scheduler.getMachine(ni);
if ( m == null ) { // not known, huh? maybe next epoch it will have checked in
refuse(j, "Cannot restore job because node " + ni.getName() + " is unknown.");
return false; // so we don't add it to global tables
} else {
DuccId id = proc.getDuccId();
Share s = new Share(id, m, j, m.getShareOrder()); // guess share order; scheduler will reset when it recovers job
long mem = proc.getResidentMemory();
logger.info(methodName, j.getId(), "Assigning share in state", state, "pid", pid, "for recovery", s.toString());
j.recoverShare(s);
s.update(j.getId(), mem, state, proc.getTimeWindowInit(), proc.getTimeWindowRun(), pid);