Java Code Examples for org.apache.hadoop.mapreduce.v2.api.records.JobState#KILLED

The following examples show how to use org.apache.hadoop.mapreduce.v2.api.records.JobState#KILLED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JobImpl.java    From hadoop with Apache License 2.0 6 votes vote down vote up
@Override
public JobState getState() {
  readLock.lock();
  try {
    JobState state = getExternalState(getInternalState());
    if (!appContext.hasSuccessfullyUnregistered()
        && (state == JobState.SUCCEEDED || state == JobState.FAILED
        || state == JobState.KILLED || state == JobState.ERROR)) {
      return lastNonFinalState;
    } else {
      return state;
    }
  } finally {
    readLock.unlock();
  }
}
 
Example 2
Source File: JobImpl.java    From hadoop with Apache License 2.0 6 votes vote down vote up
private JobState getExternalState(JobStateInternal smState) {
  switch (smState) {
  case KILL_WAIT:
  case KILL_ABORT:
    return JobState.KILLED;
  case SETUP:
  case COMMITTING:
    return JobState.RUNNING;
  case FAIL_WAIT:
  case FAIL_ABORT:
    return JobState.FAILED;
  case REBOOT:
    if (appContext.isLastAMRetry()) {
      return JobState.ERROR;
    } else {
      // In case of not last retry, return the external state as RUNNING since
      // otherwise JobClient will exit when it polls the AM for job state
      return JobState.RUNNING;
    }
  default:
    return JobState.valueOf(smState.name());
  }
}
 
Example 3
Source File: JobImpl.java    From big-c with Apache License 2.0 6 votes vote down vote up
@Override
public JobState getState() {
  readLock.lock();
  try {
    JobState state = getExternalState(getInternalState());
    if (!appContext.hasSuccessfullyUnregistered()
        && (state == JobState.SUCCEEDED || state == JobState.FAILED
        || state == JobState.KILLED || state == JobState.ERROR)) {
      return lastNonFinalState;
    } else {
      return state;
    }
  } finally {
    readLock.unlock();
  }
}
 
Example 4
Source File: JobImpl.java    From big-c with Apache License 2.0 6 votes vote down vote up
private JobState getExternalState(JobStateInternal smState) {
  switch (smState) {
  case KILL_WAIT:
  case KILL_ABORT:
    return JobState.KILLED;
  case SETUP:
  case COMMITTING:
    return JobState.RUNNING;
  case FAIL_WAIT:
  case FAIL_ABORT:
    return JobState.FAILED;
  case REBOOT:
    if (appContext.isLastAMRetry()) {
      return JobState.ERROR;
    } else {
      // In case of not last retry, return the external state as RUNNING since
      // otherwise JobClient will exit when it polls the AM for job state
      return JobState.RUNNING;
    }
  default:
    return JobState.valueOf(smState.name());
  }
}
 
Example 5
Source File: JobImpl.java    From hadoop with Apache License 2.0 5 votes vote down vote up
private void rememberLastNonFinalState(JobStateInternal stateInternal) {
  JobState state = getExternalState(stateInternal);
  // if state is not the final state, set lastNonFinalState
  if (state != JobState.SUCCEEDED && state != JobState.FAILED
      && state != JobState.KILLED && state != JobState.ERROR) {
    lastNonFinalState = state;
  }
}
 
Example 6
Source File: PartialJob.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@Override
public JobState getState() {
  JobState js = null;
  try {
    js = JobState.valueOf(jobIndexInfo.getJobStatus());
  } catch (Exception e) {
    // Meant for use by the display UI. Exception would prevent it from being
    // rendered.e Defaulting to KILLED
    LOG.warn("Exception while parsing job state. Defaulting to KILLED", e);
    js = JobState.KILLED;
  }
  return js;
}
 
Example 7
Source File: JobImpl.java    From big-c with Apache License 2.0 5 votes vote down vote up
private void rememberLastNonFinalState(JobStateInternal stateInternal) {
  JobState state = getExternalState(stateInternal);
  // if state is not the final state, set lastNonFinalState
  if (state != JobState.SUCCEEDED && state != JobState.FAILED
      && state != JobState.KILLED && state != JobState.ERROR) {
    lastNonFinalState = state;
  }
}
 
Example 8
Source File: PartialJob.java    From big-c with Apache License 2.0 5 votes vote down vote up
@Override
public JobState getState() {
  JobState js = null;
  try {
    js = JobState.valueOf(jobIndexInfo.getJobStatus());
  } catch (Exception e) {
    // Meant for use by the display UI. Exception would prevent it from being
    // rendered.e Defaulting to KILLED
    LOG.warn("Exception while parsing job state. Defaulting to KILLED", e);
    js = JobState.KILLED;
  }
  return js;
}