Package org.apache.hadoop.mapreduce.v2.api.records

Examples of org.apache.hadoop.mapreduce.v2.api.records.JobState


  @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 {
View Full Code Here


      writeLock.unlock();
    }
  }

  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;
    }
View Full Code Here

    return jobIndexInfo.getQueueName();
  }

  @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
View Full Code Here

  @Test
  public void testFromYarnJobReport() throws Exception {
    int jobStartTime = 612354;
    int jobFinishTime = 612355;
    JobState state = JobState.RUNNING;
    JobId jobId = Records.newRecord(JobId.class);
    JobReport jobReport = Records.newRecord(JobReport.class);
    ApplicationId applicationId = ApplicationId.newInstance(0, 0);
    jobId.setAppId(applicationId);
    jobId.setId(0);   
    jobReport.setJobId(jobId);
    jobReport.setJobState(state);
    jobReport.setStartTime(jobStartTime);
    jobReport.setFinishTime(jobFinishTime);
    jobReport.setUser("TestTypeConverter-user");   
    JobStatus jobStatus = TypeConverter.fromYarn(jobReport, "dummy-jobfile");
    Assert.assertEquals(jobStartTime, jobStatus.getStartTime());
    Assert.assertEquals(jobFinishTime, jobStatus.getFinishTime());   
    Assert.assertEquals(state.toString(), jobStatus.getState().toString());
 
View Full Code Here

    if (fBegin != null && fEnd != null && fBegin > fEnd) {
      throw new BadRequestException(
          "finishedTimeEnd must be greater than finishedTimeBegin");
    }
   
    JobState jobState = null;
    if (stateQuery != null) {
      jobState = JobState.valueOf(stateQuery);
    }

    return ctx.getPartialJobs(0l, countParam, userQuery, queueQuery,
View Full Code Here

  public Counters getAllCounters() {

    readLock.lock();

    try {
      JobState state = getState();
      if (state == JobState.ERROR || state == JobState.FAILED
          || state == JobState.KILLED || state == JobState.SUCCEEDED) {
        this.mayBeConstructFinalFullCounters();
        return fullCounters;
      }
View Full Code Here

  @Override
  public JobReport getReport() {
    readLock.lock();
    try {
      JobState state = getState();

      // jobFile can be null if the job is not yet inited.
      String jobFile =
          remoteJobConfFile == null ? "" : remoteJobConfFile.toString();
View Full Code Here

   */
  public void handle(JobEvent event) {
    LOG.debug("Processing " + event.getJobId() + " of type " + event.getType());
    try {
      writeLock.lock();
      JobState oldState = getState();
      try {
         getStateMachine().doTransition(event.getType(), event);
      } catch (InvalidStateTransitonException e) {
        LOG.error("Can't handle this event at current state", e);
        addDiagnostic("Invalid event " + event.getType() +
View Full Code Here

        job.addDiagnostic(diagnosticMsg);
        job.abortJob(org.apache.hadoop.mapreduce.JobStatus.State.FAILED);
        return job.finished(JobState.FAILED);
      }
     
      JobState jobCompleteSuccess = JobImpl.checkJobCompleteSuccess(job);
      if (jobCompleteSuccess != null) {
        return jobCompleteSuccess;
      }
     
      //return the current state, Job not finished yet
View Full Code Here

  static class JobNoTasksCompletedTransition implements
  MultipleArcTransition<JobImpl, JobEvent, JobState> {

    @Override
    public JobState transition(JobImpl job, JobEvent event) {
      JobState jobCompleteSuccess = JobImpl.checkJobCompleteSuccess(job);
      if (jobCompleteSuccess != null) {
        return jobCompleteSuccess;
      }
     
      // Return the current state, Job not finished yet
View Full Code Here

TOP

Related Classes of org.apache.hadoop.mapreduce.v2.api.records.JobState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.