Esempio n. 1
0
  // Launch Input/DistCache Data Generation job and wait for completion
  void launchGridmixJob(GridmixJob job) throws IOException, InterruptedException {
    submitter.add(job);

    // TODO add listeners, use for job dependencies
    try {
      while (!job.isSubmitted()) {
        try {
          Thread.sleep(100); // sleep
        } catch (InterruptedException ie) {
        }
      }
      // wait for completion
      job.getJob().waitForCompletion(false);
    } catch (ClassNotFoundException e) {
      throw new IOException("Internal error", e);
    }
    if (!job.getJob().isSuccessful()) {
      throw new IOException(job.getJob().getJobName() + " job failed!");
    }
  }