This function unregisters the job from callback
listener. The job status will not be updated.

@throws GramException if an error occurs during unregistering
@param job the job
516438
public static void unregisterListener(GramJob job)
	throws GramException, GSSException {

        CallbackHandler handler;

        GSSCredential cred = getJobCredentials(job);

        handler = initCallbackHandler(cred);

        unregisterListener(job, handler);
    }
662240
protected void jobListenersBeforeJob() {
        List<JobListenerProxy> jobListeners = listenerFactory.getJobListeners();
        for (JobListenerProxy listenerProxy : jobListeners) {
            if (logger.isLoggable(Level.FINE)) {
                logger.fine("Invoking beforeJob() on jobListener: " + listenerProxy.getDelegate() + " of type: " + listenerProxy.getDelegate().getClass());
            }
            listenerProxy.beforeJob();
        }
    }
1020247
public void addListener(GramJobListener listener) {
	if (listeners == null) listeners = new Vector();
	listeners.addElement(listener);
    }
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);
        }
    }
1010220
public function deleteReserved($queue, $job)
    {
        parent::deleteReserved($queue, $job);

        $this->event($this->getQueue($queue), new JobDeleted($job, $job->getReservedJob()));
    }
1333968
public void unregister(Object eventListener) throws MangooEventBusException {
        Objects.requireNonNull(eventListener, Required.EVENT_LISTENER.toString());
        
        try {
            this.eventBus.unregister(eventListener);
        } catch (IllegalArgumentException e) {
            throw new MangooEventBusException(e);
        }

        if (this.listeners.get() > 0) {
            this.listeners.getAndDecrement();            
        }
    }
1334307
public void setJobClass(Class<? extends Job> jobClass) {

    if (jobClass == null) {
      throw new IllegalArgumentException("Job class cannot be null.");
    }

    if (!Job.class.isAssignableFrom(jobClass)) {
      throw new IllegalArgumentException("Job class must implement the Job interface.");
    }

    this.jobClass = jobClass;
  }
1294927
public void registerListener(JobID jobId, KvStateRegistryListener listener) {
		final KvStateRegistryListener previousValue = listeners.putIfAbsent(jobId, listener);

		if (previousValue != null) {
			throw new IllegalStateException("Listener already registered under " + jobId + '.');
		}
	}
754817
public <EventT> boolean unregister(Object key, Class<EventT> eventClass) {
    LOG.debug("[{}] Unregistering {} for {}", logPrefix, key, eventClass);
    return listeners.remove(eventClass, key);
  }
1021942
public void onRenamed(TopLevelItem job, String oldName, String newName) throws IOException {
        items.remove(oldName);
        items.put(newName,job);

        // For compatibility with old views:
        for (View v : views)
            v.onJobRenamed(job, oldName, newName);
    }
442862
public void purgeJob(final HadoopJob job) {
    runningJobs.remove(job.getJobID());
    Display.getDefault().asyncExec(new Runnable() {
      public void run() {
        fireJobRemoved(job);
      }
    });
  }
246824
private void jobListenersAfterJob() {
        List<JobListenerProxy> jobListeners = listenerFactory.getJobListeners();
        for (JobListenerProxy listenerProxy : jobListeners) {
            if (logger.isLoggable(Level.FINE)) {
                logger.fine(" Invoking afterJob() on jobListener: " + listenerProxy.getDelegate() + " of type: " + listenerProxy.getDelegate().getClass());
            }
            listenerProxy.afterJob();
        }
    }
811279
void preInitializeJob(JobInProgress job) {
    JobConf jobConf = job.getJobConf();
    
    // Compute number of slots required to run a single map/reduce task
    int slotsPerMap = 1;
    int slotsPerReduce = 1;
    if (memoryMatcher.isSchedulingBasedOnMemEnabled()) {
      slotsPerMap = jobConf.computeNumSlotsPerMap(getMemSizeForMapSlot());
     slotsPerReduce = 
       jobConf.computeNumSlotsPerReduce(getMemSizeForReduceSlot());
    }
    job.setNumSlotsPerMap(slotsPerMap);
    job.setNumSlotsPerReduce(slotsPerReduce);
  }
950024
protected synchronized void purgeJob(KillJobAction action) throws IOException {
    JobID jobId = action.getJobID();
    LOG.info("Received 'KillJobAction' for job: " + jobId);
    RunningJob rjob = null;
    synchronized (runningJobs) {
      rjob = runningJobs.get(jobId);
    }

    if (rjob == null) {
      if (LOG.isDebugEnabled()) {
        // We cleanup the job on all tasktrackers in the cluster
        // so there is a good chance it never ran a single task from it
        LOG.debug("Unknown job " + jobId + " being deleted.");
      }
    } else {
      synchronized (rjob) {
        // Add this tips of this job to queue of tasks to be purged
        for (TaskInProgress tip : rjob.tasks) {
          tip.jobHasFinished(false);
          Task t = tip.getTask();
          if (t.isMapTask()) {
            indexCache.removeMap(tip.getTask().getTaskID().toString());
          }
          
          // Remove it from the runningTasks
          if (this.runningTasks.containsKey(t.getTaskID())) {
            LOG.info("Remove " + t.getTaskID() + " from runningTask by purgeJob");
            this.runningTasks.remove(t.getTaskID());
          }
        }
        // Delete the job directory for this
        // task if the job is done/failed
        if (!rjob.keepJobFiles){
          PathDeletionContext[] contexts = buildPathDeletionContexts(localFs,
              getLocalFiles(fConf, getLocalJobDir(rjob.getJobID().toString())));
          directoryCleanupThread.addToQueue(contexts);
        }
        // Remove this job
        rjob.tasks.clear();
      }
    }

    synchronized(runningJobs) {
      runningJobs.remove(jobId);
    }

  }
806022
protected Object execute(final Job job, final String curQueue, final Object instance) throws Exception {
        if (instance instanceof WorkerAware) {
            ((WorkerAware) instance).setWorker(this);
        }
        this.listenerDelegate.fireEvent(JOB_EXECUTE, this, curQueue, job, instance, null, null);
        final Object result;
        if (instance instanceof Callable) {
            result = ((Callable<?>) instance).call(); // The job is executing!
        } else if (instance instanceof Runnable) {
            ((Runnable) instance).run(); // The job is executing!
            result = null;
        } else { // Should never happen since we're testing the class earlier
            throw new ClassCastException(
                    "Instance must be a Runnable or a Callable: " + instance.getClass().getName() + " - " + instance);
        }
        return result;
    }
767511
public void doMonitor() {
    while (running) {
      String[] keys = null;
      // Make a copy of the names of the current jobs.
      synchronized(jobs) {
        keys = jobs.keySet().toArray(new String[0]);
      }

      // Check all the jobs. We do not want to block access to `jobs`
      // because that will prevent new jobs from being added.
      // This is safe because JobMonitor.run is the only code that can
      // remove a job from `jobs`. Thus all elements in `keys` will have
      // valid values.
      Map<String, List<DistRaid>> finishedJobs =
        new HashMap<String, List<DistRaid>>();

      for (String key: keys) {
        // For each policy being monitored, get the list of jobs running.
        DistRaid[] jobListCopy = null;
        synchronized(jobs) {
          List<DistRaid> jobList = jobs.get(key);
          synchronized(jobList) {
            jobListCopy = jobList.toArray(new DistRaid[jobList.size()]);
          }
        }
        // The code that actually contacts the JobTracker is not synchronized,
        // it uses copies of the list of jobs.
        for (DistRaid job: jobListCopy) {
          // Check each running job.
          try {
            boolean complete = job.checkComplete();
            if (complete) {
              addJob(finishedJobs, key, job);
              if (job.successful()) {
                jobsSucceeded++;
              }
            } else if (System.currentTimeMillis() -
                job.getStartTime() > maximumRunningTime){
              // If the job is running for more than one day
              throw new Exception("Job " + job.getJobID() + 
                  " is hanging more than " + maximumRunningTime/1000
                  + " seconds. Kill it");
            }
          } catch (Exception e) {
            // If there was an error, consider the job finished.
            addJob(finishedJobs, key, job);
            try {
              job.killJob();
            } catch (Exception ee) {
              LOG.error(ee);
            }
          }
        }
      }

      if (finishedJobs.size() > 0) {
        for (String key: finishedJobs.keySet()) {
          List<DistRaid> finishedJobList = finishedJobs.get(key);
          // Iterate through finished jobs and remove from jobs.
          // removeJob takes care of locking.
          for (DistRaid job: finishedJobList) {
            addCounter(raidProgress, job, INT_CTRS);
            removeJob(jobs, key, job);
            addJob(history, key, job);
            // delete the temp directory 
            job.cleanUp();
          }
        }
      }

      try {
        Thread.sleep(jobMonitorInterval);
      } catch (InterruptedException ie) {
      }
    }
  }
672631
public void registerJob(GramJob job) {
	String id = job.getIDAsString();
	_jobs.put(id, job);
    }