Package eu.stratosphere.nephele.client

Examples of eu.stratosphere.nephele.client.JobCancelResult


    LOG.info("Trying to cancel job with ID " + jobID);

    final ExecutionGraph eg = this.scheduler.getExecutionGraphByID(jobID);
    if (eg == null) {
      return new JobCancelResult(ReturnCode.ERROR, "Cannot find job with ID " + jobID);
    }

    final Runnable cancelJobRunnable = new Runnable() {

      @Override
      public void run() {
        eg.updateJobStatus(InternalJobStatus.CANCELING, "Job canceled by user");
        final TaskCancelResult cancelResult = cancelJob(eg);
        if (cancelResult != null) {
          LOG.error(cancelResult.getDescription());
        }
      }
    };

    eg.executeCommand(cancelJobRunnable);

    LOG.info("Cancel of job " + jobID + " successfully triggered");

    return new JobCancelResult(AbstractJobResult.ReturnCode.SUCCESS, null);
  }
View Full Code Here


          // Cancel job
          if (startingTime + msecsTillCanceling < now) {

            LOG.info("Issuing cancel request");

            final JobCancelResult jcr = client.cancelJob();

            if (jcr == null) {
              throw new IllegalStateException("Return value of cancelJob is null!");
            }

            if (jcr.getReturnCode() != AbstractJobResult.ReturnCode.SUCCESS) {
              throw new IllegalStateException(jcr.getDescription());
            }

            // Save when the cancel request has been issued
            cancelTime = now;
          }
View Full Code Here

TOP

Related Classes of eu.stratosphere.nephele.client.JobCancelResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.