Exemplo n.º 1
0
  @Override
  protected Job handleJobResult(JobResult received, IbisIdentifier from) {
    // TODO Auto-generated method stub
    String cluster = from.location().getParent().toString();

    System.err.println(from.location().toString() + " " + received.getStats().getRuntime());

    /* assumes jobs don't need to be replicated on the same cluster, except on failure */
    Job doneJob = schedJobs.remove(received.getJobID());

    workers
        .get(cluster)
        .get(from.location().getLevel(0))
        .addJobStats(received.getStats().getRuntime());
    /*create category if it doesn't exist yet
     * upper duration since we pay in discrete increments of priced time unit*/

    doneJobs.put(doneJob.getJobID(), doneJob);

    if (hosts.get(from.location().toString()).schedJobs.size() == 0) return sayGB(from);

    Job nextJob = hosts.get(from.location().toString()).schedJobs.remove(0);
    nextJob.startTime = System.nanoTime();

    return nextJob;
  }