Package org.apache.hadoop.mapred.JobClient

Examples of org.apache.hadoop.mapred.JobClient.NetworkedJob


          LOG.info("taskid is :" + taskid);
          if (i==0) {
            taskIdKilled = taskid.toString();
            taskAttemptID = new TaskAttemptID(taskid, i);
            LOG.info("taskAttemptid going to be killed is : " + taskAttemptID);
            (jobClient.new NetworkedJob(jInfo.getStatus())).
                killTask(taskAttemptID,true);
            checkTaskCompletionEvent(taskAttemptID, jInfo);
            break;
          } else {
            if (taskIdKilled.equals(taskid.toString())) {
              taskAttemptID = new TaskAttemptID(taskid, i);
              //Make sure that task is midway and then kill
              UtilsForTests.waitFor(20000);
              LOG.info("taskAttemptid going to be killed is : " +
                  taskAttemptID);
              (jobClient.new NetworkedJob(jInfo.getStatus())).
                  killTask(taskAttemptID,true);
              checkTaskCompletionEvent(taskAttemptID,jInfo);
              break;
            }
          }
View Full Code Here


  public void checkTaskCompletionEvent (TaskAttemptID taskAttemptID,
      JobInfo jInfo) throws Exception {
    boolean match = false;
    int count = 0;
    while (!match) {
      TaskCompletionEvent[] taskCompletionEvents =  jobClient.new
        NetworkedJob(jInfo.getStatus()).getTaskCompletionEvents(0);
      for (TaskCompletionEvent taskCompletionEvent : taskCompletionEvents) {
        LOG.info("taskCompletionEvent.getTaskAttemptId().toString() is : " +
          taskCompletionEvent.getTaskAttemptId().toString());
        LOG.info("compared to taskAttemptID.toString() :" +
View Full Code Here

          TaskAttemptID taskAttID = new TaskAttemptID(taskId,
              taskinfo.numFailedAttempts());
          int MAX_MAP_TASK_ATTEMPTS = Integer.
               parseInt(jobConf.get("mapred.map.max.attempts"));
          while(taskinfo.numFailedAttempts() < MAX_MAP_TASK_ATTEMPTS) {
            NetworkedJob networkJob = jtClient.getClient().
               new NetworkedJob(jobInfo.getStatus());
            networkJob.killTask(taskAttID, true);
            taskinfo = rtClient.getTaskInfo(taskinfo.getTaskID());
            taskAttID = new TaskAttemptID(taskId, taskinfo.numFailedAttempts());
            jobInfo = rtClient.getJobInfo(jobId);
          }
          isFailTask=true;
View Full Code Here

    }

    Assert.assertTrue("Task has not been started for 1 min.",
      count != 60);

    NetworkedJob networkJob = (cluster.getJTClient().getClient()).new
      NetworkedJob(jInfo.getStatus());
    TaskID tID = TaskID.downgrade(taskInfo.getTaskID());
    TaskAttemptID taskAttID = new TaskAttemptID(tID , 0);
    networkJob.killTask(taskAttID, false);

    count = 0;
    LOG.info("Waiting till the job is completed...");
    while (!jInfo.getStatus().isJobComplete()) {
      UtilsForTests.waitFor(1000);
View Full Code Here


    Assert.assertTrue("Map process is not alive before task kills.",
        ttIns.isProcessTreeAlive(pid));

    NetworkedJob networkJob = client.new NetworkedJob(jInfo.getStatus());
    networkJob.killTask(taskAttID, false);

    LOG.info("Waiting till the task is killed...");
    taskInfo = wovenClient.getTaskInfo(taskInfo.getTaskID());
    counter = 0;
    while (counter < 30) {
View Full Code Here

    Assert.assertNotNull("TaskInfo is null",taskInfo);
    Assert.assertTrue("Task has not been started for 1 min.",
        jtClient.isTaskStarted(taskInfo));

    JobInfo jInfo = wovenClient.getJobInfo(jobId);
    NetworkedJob networkJob = client.new NetworkedJob(jInfo.getStatus());
    TaskID tID = TaskID.downgrade(taskInfo.getTaskID());
    TaskAttemptID taskAttID = new TaskAttemptID(tID, 0);
    networkJob.killTask(taskAttID, false);

    int counter = 0;
    while (counter++ < 60) {
      if (taskInfo.getTaskStatus().length == 0) {
        UtilsForTests.waitFor(1000);
View Full Code Here

    Assert.assertNotNull("TaskInfo is null",taskInfo);
    Assert.assertTrue("Task has not been started for 1 min.",
        jtClient.isTaskStarted(taskInfo));
   
    JobInfo jInfo = wovenClient.getJobInfo(jobId);
    NetworkedJob networkJob = client.new NetworkedJob(jInfo.getStatus());
    TaskID tID = TaskID.downgrade(taskInfo.getTaskID());
    TaskAttemptID taskAttID = new TaskAttemptID(tID, 0);
    networkJob.killTask(taskAttID, true);

    int counter = 0;
    while (counter++ < 60) {
      if (taskInfo.getTaskStatus().length == 0) {
        UtilsForTests.waitFor(1000);
View Full Code Here

      JobClient client = new JobClient(mr.getConfig());

      RunningJob rj = client.submitJob(job);
      JobID jobId = rj.getID();
      NetworkedJob runningJob = (NetworkedJob) client.getJob(jobId);
      runningJob.setJobPriority(JobPriority.HIGH.name());
      // test getters
      assertTrue(runningJob.getConfiguration().toString()
          .endsWith("0001/job.xml"));
      assertEquals(runningJob.getID(), jobId);
      assertEquals(runningJob.getJobID(), jobId.toString());
      assertTrue(runningJob.getJobName().contains( "hadoop-"));
      assertTrue(runningJob.getJobFile().endsWith(
          ".staging/" + runningJob.getJobID() + "/job.xml"));
      assertTrue(runningJob.getTrackingURL().length() > 0);
      assertTrue(runningJob.mapProgress() == 0.0f);
      assertTrue(runningJob.reduceProgress() == 0.0f);
      assertTrue(runningJob.cleanupProgress() == 0.0f);
      assertTrue(runningJob.setupProgress() == 0.0f);

      TaskCompletionEvent[] tce = runningJob.getTaskCompletionEvents(0);
      assertEquals(tce.length, 0);

      assertEquals(runningJob.getHistoryUrl(),"");
      assertFalse(runningJob.isRetired());
      assertEquals( runningJob.getFailureInfo(),"");
      assertEquals(client.getMapTaskReports(jobId).length, 0);
     
      try {
        client.getSetupTaskReports(jobId);
      } catch (YarnException e) {
View Full Code Here

      JobClient client = new JobClient(mr.getConfig());

      RunningJob rj = client.submitJob(job);
      JobID jobId = rj.getID();
      NetworkedJob runningJob = (NetworkedJob) client.getJob(jobId);
      runningJob.setJobPriority(JobPriority.HIGH.name());
      // test getters
      assertTrue(runningJob.getConfiguration().toString()
          .endsWith("0001/job.xml"));
      assertEquals(runningJob.getID(), jobId);
      assertEquals(runningJob.getJobID(), jobId.toString());
      assertEquals(runningJob.getJobName(), "N/A");
      assertTrue(runningJob.getJobFile().endsWith(
          ".staging/" + runningJob.getJobID() + "/job.xml"));
      assertTrue(runningJob.getTrackingURL().length() > 0);
      assertTrue(runningJob.mapProgress() == 0.0f);
      assertTrue(runningJob.reduceProgress() == 0.0f);
      assertTrue(runningJob.cleanupProgress() == 0.0f);
      assertTrue(runningJob.setupProgress() == 0.0f);

      TaskCompletionEvent[] tce = runningJob.getTaskCompletionEvents(0);
      assertEquals(tce.length, 0);

      assertEquals(runningJob.getHistoryUrl(),"");
      assertFalse(runningJob.isRetired());
      assertEquals( runningJob.getFailureInfo(),"");
      assertEquals(runningJob.getJobStatus().getJobName(), "N/A");
      assertEquals(client.getMapTaskReports(jobId).length, 0);
     
      try {
        client.getSetupTaskReports(jobId);
      } catch (YarnRuntimeException e) {
View Full Code Here

      taskInfo = remoteJTClient.getTaskInfo(taskInfo.getTaskID());
      counter++;
    }
    Assert.assertTrue("Task has not been started for 1 min.", counter != 60);

    NetworkedJob networkJob = jobClient.new NetworkedJob(jInfo.getStatus());
    TaskID tID = TaskID.downgrade(taskInfo.getTaskID());
    TaskAttemptID taskAttID = new TaskAttemptID(tID, 0);
    networkJob.killTask(taskAttID, false);

    LOG.info("Waiting till the job is completed...");
    while (!jInfo.getStatus().isJobComplete()) {
      UtilsForTests.waitFor(100);
      jInfo = remoteJTClient.getJobInfo(id);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.mapred.JobClient.NetworkedJob

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.