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

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


      for (Map.Entry<JobId, Job> entry : jobsMap.entrySet()) {
        JOB_STATES.remove(entry.getValue().getState());
      }

    assertTrue("No unused job states", JOB_STATES.size() > 0);
    JobState notInUse = JOB_STATES.get(0);

    ClientResponse response = r.path("ws").path("v1").path("history")
        .path("mapreduce").path("jobs").queryParam("state", notInUse.toString())
        .accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);

    assertEquals(MediaType.APPLICATION_JSON_TYPE, response.getType());
    JSONObject json = response.getEntity(JSONObject.class);
    assertEquals("incorrect number of elements", 1, json.length());
View Full Code Here


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

      if (getState() == JobState.NEW) {
        return MRBuilderUtils.newJobReport(jobId, jobName, username, state,
            appSubmitTime, startTime, finishTime, setupProgress, 0.0f, 0.0f,
            cleanupProgress, remoteJobConfFile.toString(), amInfos);
View Full Code Here

   */
  public void handle(JobEvent event) {
    LOG.info("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

    tasks.put(mockTask.getID(), mockTask);
    when(mockJob.getTasks()).thenReturn(tasks);

    when(mockJob.getState()).thenReturn(JobState.ERROR);
    JobEvent mockJobEvent = mock(JobEvent.class);
    JobState state = trans.transition(mockJob, mockJobEvent);
    Assert.assertEquals("Incorrect state returned from JobNoTasksCompletedTransition",
        JobState.ERROR, state);
  }
View Full Code Here

    return jobIndexInfo.getJobName();
  }

  @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

      for (Map.Entry<JobId, Job> entry : jobsMap.entrySet()) {
        JOB_STATES.remove(entry.getValue().getState());
      }

    assertTrue("No unused job states", JOB_STATES.size() > 0);
    JobState notInUse = JOB_STATES.get(0);

    ClientResponse response = r.path("ws").path("v1").path("history")
        .path("mapreduce").path("jobs").queryParam("state", notInUse.toString())
        .accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);

    assertEquals(MediaType.APPLICATION_JSON_TYPE, response.getType());
    JSONObject json = response.getEntity(JSONObject.class);
    assertEquals("incorrect number of elements", 1, json.length());
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

  @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

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.