示例#1
0
  private void init() {
    failedJobs = new LinkedList<Job>();
    doneJobs = new LinkedList<Job>();
    waitingJobs = new LinkedList<Job>();
    runningJobs = new LinkedList<Job>();
    readyJobs = new LinkedList<Job>();

    failedSubLocs = new LinkedList<String>();
    doneSubLocs = new LinkedList<String>();
    waitingSubLocs = new LinkedList<String>();
    runningSubLocs = new LinkedList<String>();

    for (final Job job : allJobs) {

      if (JobConstants.DONE == job.getStatus()) {
        addDone(job);
      } else if (JobConstants.FINISHED_EITHER_WAY <= job.getStatus()) {
        addFailed(job);
      } else if (JobConstants.UNSUBMITTED > job.getStatus()) {
        addReadyJob(job);
      } else if (JobConstants.PENDING >= job.getStatus()) {
        addWaiting(job);
      } else {
        addRunning(job);
      }
    }

    doneSubLocs.removeAll(failedSubLocs);
    runningSubLocs.removeAll(failedSubLocs);
    waitingSubLocs.removeAll(failedSubLocs);
    waitingSubLocs.removeAll(doneSubLocs);
    waitingSubLocs.removeAll(runningSubLocs);
  }
示例#2
0
  private void addFailed(Job job) {

    failedJobs.add(job);
    failedSubLocs.add(job.getJobProperty(Constants.SUBMISSIONLOCATION_KEY));
  }
示例#3
0
  private void addWaiting(Job job) {

    waitingJobs.add(job);
    waitingSubLocs.add(job.getJobProperty(Constants.SUBMISSIONLOCATION_KEY));
  }
示例#4
0
  private void addDone(Job job) {

    doneJobs.add(job);
    doneSubLocs.add(job.getJobProperty(Constants.SUBMISSIONLOCATION_KEY));
  }