Package org.apache.hadoop.mapred

Examples of org.apache.hadoop.mapred.JobStatus


  public void generateJobTable(JspWriter out, String label, List<JobInProgress> jobs)
      throws IOException {
    if (jobs.size() > 0) {
      for (JobInProgress job : jobs) {
        JobProfile profile = job.getProfile();
        JobStatus status = job.getStatus();
        JobID jobid = profile.getJobID();

        int desiredMaps = job.desiredMaps();
        int desiredReduces = job.desiredReduces();
        int completedMaps = job.finishedMaps();
        int completedReduces = job.finishedReduces();
        String name = profile.getJobName();

        out.print("<" + label + "_job jobid=\"" + jobid + "\">\n");
        out.print("  <jobid>" + jobid + "</jobid>\n");
        out.print("  <user>" + profile.getUser() + "</user>\n");
        out.print("  <name>" + ("".equals(name) ? "&nbsp;" : name) + "</name>\n");
        out.print("  <map_complete>" + StringUtils.formatPercent(status.mapProgress(), 2) + "</map_complete>\n");
        out.print("  <map_total>" + desiredMaps + "</map_total>\n");
        out.print("  <maps_completed>" + completedMaps + "</maps_completed>\n");
        out.print("  <reduce_complete>" + StringUtils.formatPercent(status.reduceProgress(), 2) + "</reduce_complete>\n");
        out.print("  <reduce_total>" + desiredReduces + "</reduce_total>\n");
        out.print("  <reduces_completed>" + completedReduces + "</reduces_completed>\n");
        out.print("</" + label + "_job>\n");
      }
    }
View Full Code Here


    public FakeJobInProgress(JobConf jobConf,
        FakeTaskTrackerManager taskTrackerManager) throws IOException {
      super(new JobID("test", ++jobCounter), jobConf);
      this.taskTrackerManager = taskTrackerManager;
      this.startTime = System.currentTimeMillis();
      this.status = new JobStatus();
      this.status.setRunState(JobStatus.PREP);
    }
View Full Code Here

    throws BadParam, IOException {
    JobID bestid = jobid;
    if (childid != null)
      bestid = StatusDelegator.StringToJobID(childid);

    JobStatus status = tracker.getJobStatus(bestid);
    JobProfile profile = tracker.getJobProfile(bestid);

    if (status == null || profile == null) {
      if (bestid != jobid) { // Corrupt childid, retry.
        LOG.error("Corrupt child id " + childid + " for " + jobid);
View Full Code Here

    public FakeJobInProgress(JobConf jobConf,
        FakeTaskTrackerManager taskTrackerManager) throws IOException {
      super(new JobID("test", ++jobCounter), jobConf);
      this.taskTrackerManager = taskTrackerManager;
      this.startTime = System.currentTimeMillis();
      this.status = new JobStatus();
      this.status.setRunState(JobStatus.PREP);
    }
View Full Code Here

        FakeTaskTrackerManager taskTrackerManager,
        JobTracker jt) throws IOException {
      super(new JobID("test", ++jobCounter), jobConf, jt);
      this.taskTrackerManager = taskTrackerManager;
      this.startTime = System.currentTimeMillis();
      this.status = new JobStatus();
      this.status.setRunState(JobStatus.PREP);
    }
View Full Code Here

        throws BadParam, IOException {
        JobID bestid = jobid;
        if (childid != null)
            bestid = StatusDelegator.StringToJobID(childid);

        JobStatus status = tracker.getJobStatus(bestid);
        JobProfile profile = tracker.getJobProfile(bestid);

        if (status == null || profile == null) {
            if (bestid != jobid) { // Corrupt childid, retry.
                LOG.error("Corrupt child id " + childid + " for " + jobid);
View Full Code Here

     int execJobCount) throws IOException {
   List<JobID> jobids = new ArrayList<JobID>();
   JobStatus [] jobStatus = client.getAllJobs();
   int numJobs = jobStatus.length;
   for (int index = 1; index <= execJobCount; index++) {
     JobStatus js = jobStatus[numJobs - index];
     JobID jobid = js.getJobID();
     String jobName = js.getJobName();
     if (!jobName.equals("GRIDMIX_GENERATE_INPUT_DATA") &&
         !jobName.equals("GRIDMIX_GENERATE_DISTCACHE_DATA")) {
       jobids.add(jobid);
     }
   }
View Full Code Here

     Thread.sleep(1000);
     jobStatus = client.getAllJobs();
     numJobs = jobStatus.length;
   }
   for (int index = 1; index <= execJobCount; index++) {
     JobStatus js = jobStatus[numJobs - index];
     JobID jobid = js.getJobID();
     RunningJob runJob = client.getJob(jobid.toString());
     String jobName = runJob.getJobName();
     if (!jobName.equals("GRIDMIX_GENERATE_INPUT_DATA") &&
         !jobName.equals("GRIDMIX_GENERATE_DISTCACHE_DATA")) {
       jobids.add(jobid);
View Full Code Here

    public FakeJobInProgress(JobConf jobConf,
        FakeTaskTrackerManager taskTrackerManager) throws IOException {
      super(new JobID("test", ++jobCounter), jobConf);
      this.taskTrackerManager = taskTrackerManager;
      this.startTime = System.currentTimeMillis();
      this.status = new JobStatus();
      this.status.setRunState(JobStatus.PREP);
    }
View Full Code Here

    public FakeJobInProgress(JobConf jobConf,
        FakeTaskTrackerManager taskTrackerManager) throws IOException {
      super(new JobID("test", ++jobCounter), jobConf);
      this.taskTrackerManager = taskTrackerManager;
      this.startTime = System.currentTimeMillis();
      this.status = new JobStatus();
      this.status.setRunState(JobStatus.PREP);
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.mapred.JobStatus

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.