@Override
  public void stop(JobInstance jobInstance)
      throws Exception {
    JobStatus currentStatus = getJobSamzaStatus(jobInstance);
    if (!currentStatus.hasBeenStarted()) {
      log.info("Job {} will not be stopped because it is currently {}.", jobInstance, currentStatus.toString());
      return;
    }

    String scriptPath = getScriptPath(jobInstance, STOP_SCRIPT_NAME);
    int resultCode = scriptRunner.runScript(scriptPath, YarnApplicationInfo.getQualifiedJobName(jobInstance));
    if (resultCode != 0) {
      throw new SamzaException("Failed to stop job. Result code: " + resultCode);
    }
  }
Extends the {@link ScriptJobProxy} with methods specific to simple Samza deployments.
samza-rest/src/main/java/org/apache/samza/rest/proxy/job/SimpleYarnJobProxy.java