Cancels a slave job, referred by it's id.

@param slaveJobId
@return whether or not the job was (found and) cancelled.
971222
public boolean cancelJob(String slaveJobId) {
        final AnalysisResultFuture resultFuture = _runningJobs.remove(slaveJobId);
        if (resultFuture != null) {
            resultFuture.cancel();
            return true;
        }
        return false;
    }
732088
protected boolean jobTooOld(final JobInfo jobInfo, final JobDefinition jobDefinition) {
        final Optional<OffsetDateTime> stopped = jobInfo.getStopped();
        if (stopped.isPresent() && jobDefinition.maxAge().isPresent()) {
            final OffsetDateTime deadlineToRerun = stopped.get().plus(jobDefinition.maxAge().get());
            return deadlineToRerun.isBefore(now());
        }

        return false;
    }
553065
@Override
  public void cancel(Serializable id) {
    logger.debug("Cancelling timer with id {}", id);
    this.ftScheduler.cancel(id);
  }
283918
private void removeScheduledJob(UUID jobId, boolean complete) {
    ScheduledJob sched = jobs.remove(jobId);
    if (sched != null) {
      if (complete) {
        sched.notifyComplete();
        if (logger.isInfoEnabled()) {
          logger.info("Job complete (" + jobId.toString() + ")");
        }
      } else {
        sched.notifyCancelled();
        if (logger.isInfoEnabled()) {
          logger.info("Job cancelled (" + jobId.toString() + ")");
        }
      }
      jobs.remove(jobId);
      scheduler.removeJob(jobId);
      sched.classManager.release();
    }
  }
9148
boolean detectLongRunningJob(long currentTime, Job job) {
		if(job.status() == JobStatus.RUNNING && !longRunningJobs.containsKey(job)) {
			int jobExecutionsCount = job.executionsCount();
			Long jobStartedtimeInMillis = job.lastExecutionStartedTimeInMillis();
			Thread threadRunningJob = job.threadRunningJob();

			if(jobStartedtimeInMillis != null
				&& threadRunningJob != null
				&& currentTime - jobStartedtimeInMillis > detectionThresholdInMillis) {
				logger.warn(
					"Job '{}' is still running after {}ms (detection threshold = {}ms), stack trace = {}",
					job.name(),
					currentTime - jobStartedtimeInMillis,
					detectionThresholdInMillis,
					Stream
						.of(threadRunningJob.getStackTrace())
						.map(StackTraceElement::toString)
						.collect(Collectors.joining("\n  "))
				);

				longRunningJobs.put(
					job,
					new LongRunningJobInfo(jobStartedtimeInMillis, jobExecutionsCount)
				);

				return true;
			}
		}
		return false;
	}
1044079
@CommandArgument
  public void cancel(int index) {
    if (jobProgressStates == null) {
      System.err.println("Server not running");
      return;
    }
    if (index <= 0 || index > jobProgressStates.size()) {
      System.err.println("Invalid job number");
    }
    ProgressState state = jobProgressStates.get(index - 1);
    state.setCancelPending();
  }
537673
public synchronized boolean unscheduleJob(final String jobName, final String groupName) throws
      SchedulerException {
    return this.scheduler.deleteJob(new JobKey(jobName, groupName));
  }
877488
def _cancel_job(self, job, force):
        """"""
        import streamsx.st as st
        if st._has_local_install:
            return st._cancel_job(job.id, force,
                domain_id=job.get_instance().get_domain().id, instance_id=job.get_instance().id)
        return False
388049
public function cancel($id, $table)
    {
        if ($this->service->cancel($id, $table)) {
            return back()->with('message', 'The job was successfully cancelled');
        }

        return back()->withErrors('Failed to cancel the job');
    }
691680
def cancel(self, job_ids):
        ''' 
        '''

        for job in job_ids:
            logger.debug("Terminating job/proc_id : {0}".format(job))
            # Here we are assuming that for local, the job_ids are the process id's
            proc = self.resources[job]['proc']
            os.killpg(os.getpgid(proc.pid), signal.SIGTERM)
            self.resources[job]['status'] = 'CANCELLED'
        rets = [True for i in job_ids]

        return rets
967919
@Override
    protected void cancelFaxJobImpl(FaxJob faxJob)
    {
        //create command
        String command=this.createCancelFaxJobProcessCommand(faxJob);
        
        //execute command
        this.executeProcess(faxJob,command,FaxActionType.CANCEL_FAX_JOB);
    }
1334534
@Override
    public void cancelJob(int idJob)
    {
        jqmlogger.trace("Job instance number " + idJob + " will be cancelled");
        DbConn cnx = null;
        try
        {
            cnx = getDbSession();
            QueryResult res = cnx.runUpdate("jj_update_cancel_by_id", idJob);
            if (res.nbUpdated != 1)
            {
                throw new JqmClientException("the job is already running, has already finished or never existed to begin with");
            }
        }
        catch (RuntimeException e)
        {
            closeQuietly(cnx);
            throw e;
        }

        try
        {
            History.create(cnx, idJob, State.CANCELLED, null);
            JobInstance.delete_id(cnx, idJob);
            cnx.commit();
        }
        catch (Exception e)
        {
            throw new JqmClientException("could not historise the job instance after it was cancelled", e);
        }
        finally
        {
            closeQuietly(cnx);
        }
    }
615117
public void unregisterJob(GramJob job) {
	String id = job.getIDAsString();
	_jobs.remove(id);
    }
634680
def cancel(self, job):
        
        if isinstance(job, self.job_class):
            self.connection.zrem(self.scheduled_jobs_key, job.id)
        else:
            self.connection.zrem(self.scheduled_jobs_key, job)
903243
@SuppressWarnings("deprecation")
    public boolean cancel(boolean sync) {

        boolean success = false;

        try {
            switch (state) {
            case WAITING:
                ParallelTaskManager.getInstance().removeTaskFromWaitQ(this);
                this.state = ParallelTaskState.COMPLETED_WITHOUT_ERROR;
                success = true;
                break;
            case IN_PROGRESS:
                if (executionManager != null
                        && !executionManager.isTerminated()) {

                    executionManager.tell(ExecutionManagerMsgType.CANCEL,
                            executionManager);
                    logger.info(
                            "Asked parallel task {} to stop from running...",
                            this.taskId);

                    if (sync) {
                        logger.info("Run cancel in SYNC mode... waiting for task to finish...");
                        while (!isCompleted()) {
                            try {
                                Thread.sleep(100L);
                            } catch (InterruptedException e) {
                                logger.error(" task {} interrupted ", this.taskId);
                            }
                        }
                        logger.info("Task completed! Cancellation is completed.");
                    } else {
                        logger.info("Run cancel in ASYNC mode... will now return...");
                    }

                } else {
                    logger.info("manager already killed or not exist..");
                }
                this.state = ParallelTaskState.COMPLETED_WITH_ERROR;
                success = true;
                break;
            case COMPLETED_WITHOUT_ERROR:
            case COMPLETED_WITH_ERROR:
                logger.info("task are already in completed state..no operation...");
                success = true;
                break;
            default:
                break;

            }

        } catch (Exception e) {
            logger.error("cancel task {} error with exception details ",
                    this.getTaskId(), e);
        }

        return success;
    }
932447
@Override
  public Job removeJob(final JobId id, final String token)
      throws JobDoesNotExistException, JobStillDeployedException, TokenVerificationException {
    log.info("removing job: id={}", id);
    final ZooKeeperClient client = provider.get("removeJob");
    final Job job = getJob(client, id);
    if (job == null) {
      throw new JobDoesNotExistException(id);
    }
    verifyToken(token, job);

    // TODO (dano): handle retry failures
    try {
      final ImmutableList.Builder<ZooKeeperOperation> operations = ImmutableList.builder();
      final UUID jobCreationOperationId = getJobCreation(client, id);
      if (jobCreationOperationId != null) {
        operations.add(delete(Paths.configJobCreation(id, jobCreationOperationId)));
      }
      operations.add(delete(Paths.configJobHosts(id)),
          delete(Paths.configJobRefShort(id)),
          delete(Paths.configJob(id)),
          // Touch the jobs root node so that its version is bumped on every job
          // change down the tree. Effectively, make it that version == cVersion.
          set(Paths.configJobs(), UUID.randomUUID().toString().getBytes()));
      client.transaction(operations.build());
    } catch (final NoNodeException e) {
      throw new JobDoesNotExistException(id);
    } catch (final NotEmptyException e) {
      throw new JobStillDeployedException(id, listJobHosts(client, id));
    } catch (final KeeperException e) {
      throw new HeliosRuntimeException("removing job " + id + " failed", e);
    }

    // Delete job history on a best effort basis
    try {
      client.deleteRecursive(Paths.historyJob(id));
    } catch (NoNodeException ignored) {
      // There's no history for this job
    } catch (KeeperException e) {
      log.warn("error removing job history for job {}", id, e);
    }

    return job;
  }
117150
@Override
  public void abortJob(JobContext context, State state) throws IOException {
    super.abortJob(context, state);
    cleanup(context);
  }