synchronized private void checkRunningJobs() throws IOException, InterruptedException { Map<String, CrunchControlledJob> oldJobs = null; oldJobs = this.runningJobs; this.runningJobs = new Hashtable<String, CrunchControlledJob>(); for (CrunchControlledJob nextJob : oldJobs.values()) { nextJob.checkState(); this.addToQueue(nextJob); } }
synchronized private void checkWaitingJobs() throws IOException, InterruptedException { Map<String, CrunchControlledJob> oldJobs = null; oldJobs = this.waitingJobs; this.waitingJobs = new Hashtable<String, CrunchControlledJob>(); for (CrunchControlledJob nextJob : oldJobs.values()) { nextJob.checkState(); this.addToQueue(nextJob); } }
for (int i = 0; i < n; i++) { pred = this.dependingJobs.get(i); State s = pred.checkState(); if (s == State.WAITING || s == State.READY || s == State.RUNNING) { break; // a pred is still not completed, continue in WAITING