Package org.apache.hadoop.tools.rumen

Examples of org.apache.hadoop.tools.rumen.JobStory


    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);
View Full Code Here


    DebugJobProducer jobProducer = new DebugJobProducer(5, configuration);
    configuration.setBoolean(SleepJob.SLEEPJOB_MAPTASK_ONLY, true);

    UserGroupInformation ugi = UserGroupInformation.getLoginUser();
    JobStory story;
    int seq = 1;
    while ((story = jobProducer.getNextJob()) != null) {
      GridmixJob gridmixJob = JobCreator.SLEEPJOB.createGridmixJob(configuration, 0,
              story, new Path("ignored"), ugi, seq++);
      gridmixJob.buildSplits(null);
View Full Code Here

    DebugJobProducer jobProducer = new DebugJobProducer(njobs, configuration);
    Configuration jconf = GridmixTestUtils.mrvl.getConfig();
    jconf.setInt(JobCreator.SLEEPJOB_RANDOM_LOCATIONS, locations);

    JobStory story;
    int seq = 1;
    while ((story = jobProducer.getNextJob()) != null) {
      GridmixJob gridmixJob = JobCreator.SLEEPJOB.createGridmixJob(jconf, 0,
              story, new Path("ignored"), ugi, seq++);
      gridmixJob.buildSplits(null);
View Full Code Here

        } else if (GenerateDistCacheData.JOB_NAME.equals(jobName)) {
          continue;
        }

        final String originalJobId = configuration.get(Gridmix.ORIGINAL_JOB_ID);
        final JobStory spec = sub.get(originalJobId);
        assertNotNull("No spec for " + jobName, spec);
        assertNotNull("No counters for " + jobName, job.getCounters());
        final String originalJobName = spec.getName();
        System.out.println("originalJobName=" + originalJobName
                + ";GridmixJobName=" + jobName + ";originalJobID=" + originalJobId);
        assertTrue("Original job name is wrong.",
                originalJobName.equals(configuration.get(Gridmix.ORIGINAL_JOB_NAME)));

        // Gridmix job seqNum contains 6 digits
        int seqNumLength = 6;
        String jobSeqNum = new DecimalFormat("000000").format(configuration.getInt(
                GridmixJob.GRIDMIX_JOB_SEQ, -1));
        // Original job name is of the format MOCKJOB<6 digit sequence number>
        // because MockJob jobNames are of this format.
        assertTrue(originalJobName.substring(
                originalJobName.length() - seqNumLength).equals(jobSeqNum));

        assertTrue("Gridmix job name is not in the expected format.",
                jobName.equals(GridmixJob.JOB_NAME_PREFIX + jobSeqNum));
        final FileStatus stat = GridmixTestUtils.dfs.getFileStatus(new Path(
                GridmixTestUtils.DEST, "" + Integer.valueOf(jobSeqNum)));
        assertEquals("Wrong owner for " + jobName, spec.getUser(),
                stat.getOwner());
        final int nMaps = spec.getNumberMaps();
        final int nReds = spec.getNumberReduces();

        final JobClient client = new JobClient(
                GridmixTestUtils.mrvl.getConfig());
        final TaskReport[] mReports = client.getMapTaskReports(JobID
                .downgrade(job.getJobID()));
View Full Code Here

   */
  @Test (timeout=10000)
  public void testCompareGridmixJob() throws Exception {
    Configuration conf = new Configuration();
    Path outRoot = new Path("target");
    JobStory jobDesc = mock(JobStory.class);
    when(jobDesc.getName()).thenReturn("JobName");
    when(jobDesc.getJobConf()).thenReturn(new JobConf(conf));
    UserGroupInformation ugi = UserGroupInformation.getCurrentUser();
    GridmixJob j1 = new LoadJob(conf, 1000L, jobDesc, outRoot, ugi, 0);
    GridmixJob j2 = new LoadJob(conf, 1000L, jobDesc, outRoot, ugi, 0);
    GridmixJob j3 = new LoadJob(conf, 1000L, jobDesc, outRoot, ugi, 1);
    GridmixJob j4 = new LoadJob(conf, 1000L, jobDesc, outRoot, ugi, 1);
View Full Code Here

    DebugJobProducer jobProducer = new DebugJobProducer(5, configuration);
    configuration.setBoolean(SleepJob.SLEEPJOB_MAPTASK_ONLY, true);

    UserGroupInformation ugi = UserGroupInformation.getLoginUser();
    JobStory story;
    int seq = 1;
    while ((story = jobProducer.getNextJob()) != null) {
      GridmixJob gridmixJob = JobCreator.SLEEPJOB.createGridmixJob(configuration, 0,
              story, new Path("ignored"), ugi, seq++);
      gridmixJob.buildSplits(null);
View Full Code Here

    DebugJobProducer jobProducer = new DebugJobProducer(njobs, configuration);
    Configuration jconf = GridmixTestUtils.mrvl.getConfig();
    jconf.setInt(JobCreator.SLEEPJOB_RANDOM_LOCATIONS, locations);

    JobStory story;
    int seq = 1;
    while ((story = jobProducer.getNextJob()) != null) {
      GridmixJob gridmixJob = JobCreator.SLEEPJOB.createGridmixJob(jconf, 0,
              story, new Path("ignored"), ugi, seq++);
      gridmixJob.buildSplits(null);
View Full Code Here

    this.jobStoryProducer = jobStoryProducer;
  }
 
  @Override
  public List<SimulatorEvent> init(long when) throws IOException {
    JobStory job = jobStoryProducer.getNextJob();
    if (job.getSubmissionTime() != when) {
      throw new IOException("Inconsistent submission time for the first job: "
          + when + " != " + job.getSubmissionTime()+".");
    }
    JobSubmissionEvent event = new JobSubmissionEvent(this, when, job);
    return Collections.<SimulatorEvent> singletonList(event);
  }
View Full Code Here

      }
      runningJobs.add(status.getJobID());
      System.out.println("Job " + status.getJobID() +
                         " is submitted at " + submitEvent.getTimeStamp());
     
      JobStory nextJob = jobStoryProducer.getNextJob();
      if (nextJob == null) {
        noMoreJobs = true;
        return SimulatorEngine.EMPTY_EVENTS;
      }
     
      return Collections.<SimulatorEvent>singletonList(
          new JobSubmissionEvent(this, nextJob.getSubmissionTime(), nextJob));
    } else if (event instanceof JobCompleteEvent) {
      JobCompleteEvent jobCompleteEvent = (JobCompleteEvent)event;
      JobStatus jobStatus = jobCompleteEvent.getJobStatus();
      System.out.println("Job " + jobStatus.getJobID() +
                         " completed at " + jobCompleteEvent.getTimeStamp() +
View Full Code Here

    }
  }

  @Override
  public JobStory getNextJob() throws IOException {
    JobStory job = getNextJobFiltered();
    if (job == null)
      return null;
    if (firstJob) {
      firstJob = false;
      relativeTime = job.getSubmissionTime() - firstJobStartTime;
    }

    return new SimulatorJobStory(job, job.getSubmissionTime() - relativeTime);
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.tools.rumen.JobStory

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.