Unschedule and delete a job.

@param jobName Job name
@throws JobException when there is anything wrong unschedule the job
543061
public void unscheduleJob(String jobName)
      throws JobException {
    if (this.scheduledJobs.containsKey(jobName)) {
      try {
        this.scheduler.getScheduler().deleteJob(this.scheduledJobs.remove(jobName));
      } catch (SchedulerException se) {
        LOG.error("Failed to unschedule and delete job " + jobName, se);
        throw new JobException("Failed to unschedule and delete job " + jobName, se);
      }
    }
  }
874358
public synchronized void clearDisappearedJob() {
        getCron4jJobList().stream().filter(job -> job.isDisappeared()).forEach(job -> {
            final LaJobKey jobKey = job.getJobKey();
            jobKeyJobMap.remove(jobKey);
            jobOrderedList.remove(job);
            job.getJobUnique().ifPresent(jobUnique -> jobUniqueJobMap.remove(jobUnique));
            cron4jTaskJobMap.remove(job.getCron4jTask());
        });
    }
525576
@Override
    public boolean removeCalendar(String calendarName, Jedis jedis) throws JobPersistenceException {
        final String calendarTriggersSetKey = redisSchema.calendarTriggersSetKey(calendarName);

        if(jedis.scard(calendarTriggersSetKey) > 0){
            throw new JobPersistenceException(String.format("There are triggers pointing to calendar %s, so it cannot be removed.", calendarName));
        }
        final String calendarHashKey = redisSchema.calendarHashKey(calendarName);
        Pipeline pipe = jedis.pipelined();
        Response<Long> deleteResponse = pipe.del(calendarHashKey);
        pipe.srem(redisSchema.calendarsSet(), calendarHashKey);
        pipe.sync();

        return deleteResponse.get() == 1;
    }
802626
@Override
    public synchronized void destroy() {
        if (JobChangeLog.isEnabled()) {
            JobChangeLog.log("#job ...Destroying scheduler completely: jobs={} scheduler={}", jobKeyJobMap.size(), cron4jScheduler);
        }
        // not use AsyncManager here, because not frequent call, keep no dependency to core
        new Thread(() -> { // to release synchronized lock to avoid deadlock
            try {
                cron4jScheduler.stop();
            } catch (RuntimeException e) {
                final String msg = "#job Failed to stop jobs: jobs={} scheduler={}";
                if (JobChangeLog.isEnabled()) {
                    JobChangeLog.log(msg, jobKeyJobMap.size(), cron4jScheduler, e);
                } else { // just in case
                    logger.info(msg, jobKeyJobMap.size(), cron4jScheduler, e);
                }
            }
            Cron4jJobHistory.clear();
        }).start();
    }
903975
def delete_job(job_id,
               deployment_name,
               token_manager=None,
               app_url=defaults.APP_URL):
    
    headers = token_manager.get_access_token_headers()
    data_url = get_data_url_for_job(job_id,
                                    deployment_name,
                                    token_manager=token_manager,
                                    app_url=app_url)

    url = '%s/api/v1/jobs/%s' % (data_url, job_id)
    response = requests.delete(url, headers=headers)

    if response.status_code != 200:
        raise JutException('Error %s: %s' % (response.status_code, response.text))
174308
public static void delete( Key k, Key job_key ) {
    if( k == null ) return;
    Value val = DKV.get(k);
    if( val == null ) return;              // Or just nothing there to delete
    if( !val.isLockable() ) UKV.remove(k); // Simple things being deleted
    else ((Lockable)val.get()).delete(job_key,0.0f); // Lockable being deleted
  }
1097594
@Path("{id}")
  @DELETE
  @Produces(APPLICATION_JSON)
  @Timed
  @ExceptionMetered
  public JobDeleteResponse delete(@PathParam("id") @Valid final JobId id,
                                  @QueryParam("token") @DefaultValue("") final String token) {
    if (!id.isFullyQualified()) {
      throw badRequest("Invalid id");
    }
    try {
      model.removeJob(id, token);
      return new JobDeleteResponse(JobDeleteResponse.Status.OK);
    } catch (JobDoesNotExistException e) {
      throw notFound(new JobDeleteResponse(JobDeleteResponse.Status.JOB_NOT_FOUND));
    } catch (JobStillDeployedException e) {
      throw badRequest(new JobDeleteResponse(JobDeleteResponse.Status.STILL_IN_USE));
    } catch (TokenVerificationException e) {
      throw forbidden(new JobDeleteResponse(JobDeleteResponse.Status.FORBIDDEN));
    }
  }
759630
public void unschedule(final org.easybatch.core.job.Job job) throws JobSchedulerException {
        String jobName = job.getName();
        LOGGER.info("Unscheduling job ''{}'' ", jobName);
        try {
            scheduler.unscheduleJob(TriggerKey.triggerKey(TRIGGER_NAME_PREFIX + jobName));
        } catch (SchedulerException e) {
            throw new JobSchedulerException(format("Unable to unschedule job '%s'", jobName), e);
        }
    }
436460
@Override
	public JobExecutionResult execute(String jobName) throws Exception {
		if (executor == null) {
			startNewSession();
		}

		Plan p = createProgramPlan(jobName);

		// Session management is disabled, revert this commit to enable
		//p.setJobId(jobID);
		//p.setSessionTimeout(sessionTimeout);

		JobExecutionResult result = executor.executePlan(p);

		this.lastJobExecutionResult = result;
		return result;
	}
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);
        }
    }
1310928
@Override
	public void interruptJob(String jobGroup, String jobName) throws SchedulerException {
		if (!config.isInterruptJobAllowed()) {
			LOGGER.warn("not allowed to interrupt any job");
			return;
		}
		JobKey jobKey = new JobKey(jobName, jobGroup);
		if (isInteruptable(jobKey)) {
			List<JobExecutionContext> executingJobs = scheduler.getCurrentlyExecutingJobs();
			JobDetail jobDetail = scheduler.getJobDetail(jobKey);
			for (JobExecutionContext jobExecutionContext : executingJobs) {
				JobDetail execJobDetail = jobExecutionContext.getJobDetail();
				if (execJobDetail.getKey().equals(jobDetail.getKey())) {
					if (LOGGER.isDebugEnabled())
						LOGGER.debug(String.format("interrupting job (%s, %s)", jobDetail.getKey().getGroup(),
								jobDetail.getKey().getName()));
					((InterruptableJob) jobExecutionContext.getJobInstance()).interrupt();
				}
			}
		}
	}
358875
def delete_job(self, job_id):
        """"""
        if hasattr(job_id, 'job_id'):
            job_id = job_id.job_id
        with self._sock_ctx() as socket:
            self._send_message('delete {0}'.format(job_id), socket)
            self._receive_word(socket, b'DELETED')
1157594
def cancel_job(self, job_id=None, job_name=None):
        
        return self._delegator.cancel_job(job_id=job_id, job_name = job_name)
895956
@Override
	public boolean removeTrigger(String groupName, String jobName, final String triggerGroup, final String triggerName) throws SchedulerException {
		if (!config.isRemoveTriggerAllowed()) {
			LOGGER.warn("not allowed to remove any trigger");
			return false;
		}
		Trigger triggerFound = findTrigger(groupName, jobName, triggerGroup, triggerName);
		if (null != triggerFound) {
			return scheduler.unscheduleJob(triggerFound.getKey());
		}
		return false;
	}
997100
private void runJobLauncherLoop() throws JobException {
    try {
      while (true) {
        currentJobLauncher = this.jobScheduler.buildJobLauncher(jobProps);
        // in "run once" case, job scheduler will remove current job from the scheduler
        boolean isEarlyStopped = this.jobScheduler.runJob(jobProps, jobListener, currentJobLauncher);
        boolean isRetriggerEnabled = this.isRetriggeringEnabled();
        if (isEarlyStopped && isRetriggerEnabled) {
          log.info("Job {} will be re-triggered.", jobProps.getProperty(ConfigurationKeys.JOB_NAME_KEY));
        } else {
          break;
        }
        currentJobLauncher = null;
      }
    } catch (Exception e) {
      log.error("Failed to run job {}", jobProps.getProperty(ConfigurationKeys.JOB_NAME_KEY), e);
      throw new JobException("Failed to run job " + jobProps.getProperty(ConfigurationKeys.JOB_NAME_KEY), e);
    }
  }
319662
public JSONObject deleteJob(String key, HashMap<String, String> params) throws JSONException {
        return oClient.delete("/hr/v2/jobs/" + key, params);
    }
845562
public void executeJob(String jobName) throws MangooSchedulerException {
        Objects.requireNonNull(this.quartzScheduler, Required.SCHEDULER.toString());
        Objects.requireNonNull(jobName, Required.JOB_NAME.toString());
        
        try {
            for (JobKey jobKey : getAllJobKeys()) {
                if (jobKey.getName().equalsIgnoreCase(jobName)) {
                    this.quartzScheduler.triggerJob(jobKey);  
                }
            }
        } catch (SchedulerException | MangooSchedulerException e) {
            throw new MangooSchedulerException(e);
        }
    }