Package org.apache.hadoop.mapreduce.test.system

Examples of org.apache.hadoop.mapreduce.test.system.JobInfo


    JobClient client = cluster.getJTClient().getClient();
   
    RunningJob rJob = client.submitJob(new JobConf(conf));
    JobID id = rJob.getID();
   
    JobInfo jInfo = wovenClient.getJobInfo(id);
   
    while (jInfo.getStatus().getRunState() != JobStatus.RUNNING) {
      Thread.sleep(1000);
      jInfo = wovenClient.getJobInfo(id);
    }
   
    LOG.info("Waiting till job starts running one map");
    jInfo = wovenClient.getJobInfo(id);
    Assert.assertEquals(jInfo.runningMaps(), 1);
   
    LOG.info("waiting for another cycle to " +
        "check if the maps dont finish off");
    Thread.sleep(1000);
    jInfo = wovenClient.getJobInfo(id);
    Assert.assertEquals(jInfo.runningMaps(), 1);
   
    TaskInfo[] taskInfos = wovenClient.getTaskInfo(id);
   
    for(TaskInfo info : taskInfos) {
      LOG.info("constructing control action to signal task to finish");
      FinishTaskControlAction action = new FinishTaskControlAction(
          TaskID.downgrade(info.getTaskID()));
      for(TTClient cli : cluster.getTTClients()) {
        cli.getProxy().sendAction(action);
      }
    }
   
    jInfo = wovenClient.getJobInfo(id);
    int i = 1;
    if (jInfo != null) {
      while (!jInfo.getStatus().isJobComplete()) {
        Thread.sleep(1000);
        jInfo = wovenClient.getJobInfo(id);
        if (jInfo == null) {
          break;
        }
        if(i > 40) {
          Assert.fail("Controlled Job with ID : "
              + jInfo.getID()
              + " has not completed in 40 seconds after signalling.");
        }
        i++;
      }
    }
View Full Code Here


      UtilsForTests.waitFor(100);
      JobClient jobClient = jtClient.getClient();
      JobID jobId =jobClient.getAllJobs()[0].getJobID();
      LOG.info("JobId:" + jobId);
      if (jobId != null) {
        JobInfo jInfo = remoteJTClient.getJobInfo(jobId);
        Assert.assertEquals("Job has not been succeeded",
            jInfo.getStatus().getRunState(), JobStatus.SUCCEEDED);
       }
    } else {
       Assert.assertTrue("Linux Task controller not found.", false);
    }
  }
View Full Code Here

    //Submitting the job
    RunningJob rJob = cluster.getJTClient().getClient().
        submitJob(jconf);

    JobInfo jInfo = remoteJTClient.getJobInfo(rJob.getID());
    LOG.info("jInfo is :" + jInfo);

    count = 0;
    while (count < 60) {
      if (jInfo.getStatus().getRunState() == JobStatus.RUNNING) {
        break;
      } else {
        UtilsForTests.waitFor(1000);
        jInfo = remoteJTClient.getJobInfo(rJob.getID());
      }
      count++;
    }
    Assert.assertTrue("Job has not been started for 1 min.",
      count != 60);

    //Assert if jobInfo is null
    Assert.assertNotNull("jobInfo is null", jInfo);

    count = 0;
    LOG.info("Waiting till the job is completed...");
    while (!jInfo.getStatus().isJobComplete()) {
      UtilsForTests.waitFor(1000);
      count++;
      jInfo = remoteJTClient.getJobInfo(rJob.getID());
      //If the count goes beyond a point, then break; This is to avoid
      //infinite loop under unforeseen circumstances. Testcase will
View Full Code Here

    //Submitting the job
    RunningJob rJob = cluster.getJTClient().getClient().
        submitJob(jconf);

    JobInfo jInfo = remoteJTClient.getJobInfo(rJob.getID());
    LOG.info("jInfo is :" + jInfo);

    count = 0;
    while (count < 60) {
      if (jInfo.getStatus().getRunState() == JobStatus.RUNNING) {
        break;
      } else {
        UtilsForTests.waitFor(1000);
        jInfo = remoteJTClient.getJobInfo(rJob.getID());
      }
      count++;
    }
    Assert.assertTrue("Job has not been started for 1 min.",
      count != 60);

    //Assert if jobInfo is null
    Assert.assertNotNull("jobInfo is null", jInfo);

    TaskInfo[] taskInfos = remoteJTClient.getTaskInfo(rJob.getID());
    for (TaskInfo taskinfo : taskInfos) {
      if (!taskinfo.isSetupOrCleanup()) {
        taskInfo = taskinfo;
        break;
      }
    }

    TTClient ttClient = cluster.getTTClientInstance(taskInfo);
    String pid = null;
    ttClient.kill();
    ttClient.waitForTTStop();
    ttClient.start();
    ttClient.waitForTTStart();

    count = 0;
    LOG.info("Waiting till the job is completed...");
    while (!jInfo.getStatus().isJobComplete()) {
      UtilsForTests.waitFor(1000);
      count++;
      jInfo = remoteJTClient.getJobInfo(rJob.getID());
      //If the count goes beyond a point, then break; This is to avoid
      //infinite loop under unforeseen circumstances. Testcase will
View Full Code Here

    TaskInfo[] taskInfos = wovenClient.getTaskInfo(jobId);
    Assert.assertTrue("Cache File1 has not been localize",
        checkLocalization(taskInfos,cacheFile1));
    Assert.assertTrue("Cache File2 has not been localize",
            checkLocalization(taskInfos,cacheFile2));
    JobInfo jInfo = wovenClient.getJobInfo(jobId);
    LOG.info("Waiting till the job is completed...");
    while (!jInfo.getStatus().isJobComplete()) {
      UtilsForTests.waitFor(100);
      jInfo = wovenClient.getJobInfo(jobId);
    }
    Assert.assertEquals("Job has not been succeeded",
        jInfo.getStatus().getRunState(), JobStatus.SUCCEEDED);
  }
View Full Code Here

    TaskInfo[] taskInfos = wovenClient.getTaskInfo(jobId);
    boolean iscacheFileLocalized = checkLocalization(taskInfos,cacheFile3);
    Assert.assertTrue("CacheFile has not been localized",
        iscacheFileLocalized);
    deleteCacheFile(new Path(tmpFolderPath, cacheFile3));
    JobInfo jInfo = wovenClient.getJobInfo(jobId);
    LOG.info("Waiting till the job is completed...");
    while (!jInfo.getStatus().isJobComplete()) {
      UtilsForTests.waitFor(100);
      jInfo = wovenClient.getJobInfo(jobId);
    }
    Assert.assertEquals("Job has not been failed",
        jInfo.getStatus().getRunState(), JobStatus.FAILED);
  }
View Full Code Here

        jobId = jtClient.getClient().getAllJobs()[0].getJobID();
      } else {
        break;
      }
    }
    JobInfo jInfo = wovenClient.getJobInfo(jobId);
    Assert.assertEquals("Job has not been succeeded",
          jInfo.getStatus().getRunState(), JobStatus.SUCCEEDED);
  }
View Full Code Here

        break;
      }
    }

    verifyProcessTreeOverLimit(taskInfo,jobId);
    JobInfo jInfo = wovenClient.getJobInfo(jobId);
    LOG.info("Waiting till the job is completed...");
    counter = 0;
    while (counter++ < 60) {
      if (jInfo == null) {
        break;
      } else if (jInfo.getStatus().isJobComplete()) {
        break;
      }
      UtilsForTests.waitFor(100);
      jInfo = wovenClient.getJobInfo(jobId);
    }
View Full Code Here

        taskInfo = tempTaskInfo;
        break;
      }
    }
    verifyProcessTreeOverLimit(taskInfo,jobId);
    JobInfo jInfo = wovenClient.getJobInfo(jobId);
    LOG.info("Waiting till the job is completed...");
    counter = 0;
    while (counter++ < 60) {
      if(jInfo == null) {
        break;
      } else if (jInfo.getStatus().isJobComplete()) {
        break;
      }
      UtilsForTests.waitFor(1000);
      jInfo = wovenClient.getJobInfo(jobId);
    }
View Full Code Here

  }
 
  private TaskInfo getTaskInfo(JobID jobId, boolean isMap)
      throws IOException {
    JTProtocol wovenClient = cluster.getJTClient().getProxy();
    JobInfo jInfo = wovenClient.getJobInfo(jobId);
    TaskInfo[] taskInfos = wovenClient.getTaskInfo(jobId);
    for (TaskInfo taskinfo : taskInfos) {
      if (!taskinfo.isSetupOrCleanup()) {
        if (taskinfo.getTaskID().isMap() == isMap) {
          return taskinfo;
View Full Code Here

TOP

Related Classes of org.apache.hadoop.mapreduce.test.system.JobInfo

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.