Package org.apache.hadoop.mapred.gridmix.Statistics

Examples of org.apache.hadoop.mapred.gridmix.Statistics.JobStats


              if (graceful && mJobs.isEmpty()) {
                break;
              }
            }
          }
          JobStats jobStats = null;
          synchronized (mJobs) {
            jobStats = mJobs.poll();
          }
          while (jobStats != null) {
            Job job = jobStats.getJob();
           
            try {
              // get the job status
              long start = System.currentTimeMillis();
              JobStatus status = job.getStatus(); // cache the job status
              long end = System.currentTimeMillis();
             
              if (LOG.isDebugEnabled()) {
                LOG.debug("Status polling for job " + job.getJobID() + " took "
                          + (end-start) + "ms.");
              }
             
              // update the job progress
              jobStats.updateJobStatus(status);
             
              // if the job is complete, let others know
              if (status.isJobComplete()) {
                if (status.getState() == JobStatus.State.SUCCEEDED) {
                  onSuccess(job);
View Full Code Here


    final GridmixJob job;
    public SubmitTask(GridmixJob job) {
      this.job = job;
    }
    public void run() {
      JobStats stats =
        Statistics.generateJobStats(job.getJob(), job.getJobDesc());
      try {
        // pre-compute split information
        try {
          long start = System.currentTimeMillis();
View Full Code Here

   */
  @Test
  @SuppressWarnings("deprecation")
  public void testJobStats() throws Exception {
    Job job = new Job() {};
    JobStats stats = new JobStats(1, 2, job);
    assertEquals("Incorrect num-maps", 1, stats.getNoOfMaps());
    assertEquals("Incorrect num-reds", 2, stats.getNoOfReds());
    assertTrue("Incorrect job", job == stats.getJob());
    assertNull("Unexpected job status", stats.getJobStatus());
   
    // add a new status
    JobStatus status = new JobStatus();
    stats.updateJobStatus(status);
    assertNotNull("Missing job status", stats.getJobStatus());
    assertTrue("Incorrect job status", status == stats.getJobStatus());
  }
View Full Code Here

    Configuration conf = new Configuration();
   
    // test dummy jobs like data-generation etc
    Job job = new Job(conf) {
    };
    JobStats stats = Statistics.generateJobStats(job, null);
    testJobStats(stats, -1, -1, null, job);
   
    // add a job desc with 2 map and 1 reduce task
    conf.setInt(GridmixJob.GRIDMIX_JOB_SEQ, 1);
   
    // test dummy jobs like data-generation etc
    job = new Job(conf) {
    };
    JobStory zjob = getCustomJobStory(2, 1);
    stats = Statistics.generateJobStats(job, zjob);
    testJobStats(stats, 2, 1, null, job);
   
    // add a job status
    JobStatus jStatus = new JobStatus();
    stats.updateJobStatus(jStatus);
    testJobStats(stats, 2, 1, jStatus, job);
   
   
    // start the statistics
    CountDownLatch startFlag = new CountDownLatch(1); // prevents the collector
                                                      // thread from starting
    Statistics statistics = new Statistics(new JobConf(), 0, startFlag);
    statistics.start();

    testClusterStats(0, 0, 0);
   
    // add to the statistics object
    statistics.addJobStats(stats);
    testClusterStats(2, 1, 1);
   
    // add another job
    JobStory zjob2 = getCustomJobStory(10, 5);
    conf.setInt(GridmixJob.GRIDMIX_JOB_SEQ, 2);
    job = new Job(conf) {
    };
   
    JobStats stats2 = Statistics.generateJobStats(job, zjob2);
    statistics.addJobStats(stats2);
    testClusterStats(12, 6, 2);
   
    // finish off one job
    statistics.add(stats2);
View Full Code Here

               es.getSimulationStartTime() >= simStartTime);
    assertTrue("Simulation start time mismatch",
               es.getSimulationStartTime() <= System.currentTimeMillis());
   
    // test with job stats
    JobStats stats = generateFakeJobStats(1, 10, true, false);
    es.update(stats);
    testExecutionSummarizer(1, 10, 0, 1, 1, 0, 0, es);
   
    // test with failed job
    stats = generateFakeJobStats(5, 1, false, false);
View Full Code Here

          throw new IOException("Test failure!");
        }
        return isSuccessful;
      };
    };
    return new JobStats(numMaps, numReds, fakeJob);
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.mapred.gridmix.Statistics.JobStats

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.