Package org.apache.hadoop.mapreduce

Examples of org.apache.hadoop.mapreduce.Cluster


 
  @SuppressWarnings("deprecation")
  @Test
  public void testMapTaskReportsWithNullJob() throws Exception {
    JobClient client = new JobClient();
    Cluster mockCluster = mock(Cluster.class);
    client.cluster = mockCluster;
    JobID id = new JobID("test",0);
   
    when(mockCluster.getJob(id)).thenReturn(null);
   
    TaskReport[] result = client.getMapTaskReports(id);
    assertEquals(0, result.length);
   
    verify(mockCluster).getJob(id);
View Full Code Here


 
  @SuppressWarnings("deprecation")
  @Test
  public void testReduceTaskReportsWithNullJob() throws Exception {
    JobClient client = new JobClient();
    Cluster mockCluster = mock(Cluster.class);
    client.cluster = mockCluster;
    JobID id = new JobID("test",0);
   
    when(mockCluster.getJob(id)).thenReturn(null);
   
    TaskReport[] result = client.getReduceTaskReports(id);
    assertEquals(0, result.length);
   
    verify(mockCluster).getJob(id);
View Full Code Here

 
  @SuppressWarnings("deprecation")
  @Test
  public void testSetupTaskReportsWithNullJob() throws Exception {
    JobClient client = new JobClient();
    Cluster mockCluster = mock(Cluster.class);
    client.cluster = mockCluster;
    JobID id = new JobID("test",0);
   
    when(mockCluster.getJob(id)).thenReturn(null);
   
    TaskReport[] result = client.getSetupTaskReports(id);
    assertEquals(0, result.length);
   
    verify(mockCluster).getJob(id);
View Full Code Here

 
  @SuppressWarnings("deprecation")
  @Test
  public void testCleanupTaskReportsWithNullJob() throws Exception {
    JobClient client = new JobClient();
    Cluster mockCluster = mock(Cluster.class);
    client.cluster = mockCluster;
    JobID id = new JobID("test",0);
   
    when(mockCluster.getJob(id)).thenReturn(null);
   
    TaskReport[] result = client.getCleanupTaskReports(id);
    assertEquals(0, result.length);
   
    verify(mockCluster).getJob(id);
View Full Code Here

      // Framework history log file location
      Path logFile = new Path(doneDir, logFileName);
      FileSystem fileSys = logFile.getFileSystem(conf);

      Cluster cluster = new Cluster(conf);
      assertEquals("Client returned wrong history url", logFile.toString(),
          cluster.getJobHistoryUrl(id));
  
      // Check if the history file exists
      assertTrue("History file does not exist", fileSys.exists(logFile));

      // check if the corresponding conf file exists
View Full Code Here

      JobBuilder.printUsage(this, "<job ID>");
      return -1;
    }
    String jobID = args[0];
    // vv NewMissingTemperatureFields
    Cluster cluster = new Cluster(getConf());
    Job job = cluster.getJob(JobID.forName(jobID));
    // ^^ NewMissingTemperatureFields
    if (job == null) {
      System.err.printf("No job with ID %s found.\n", jobID);
      return -1;
    }
View Full Code Here

        return fs.getDefaultBlockSize(path);
    }

    public static Counters getCounters(Job job) throws IOException {
        try {
            Cluster cluster = new Cluster(job.getJobConf());
            org.apache.hadoop.mapreduce.Job mrJob = cluster.getJob(job.getAssignedJobID());
            if (mrJob == null) { // In local mode, mrJob will be null
                mrJob = job.getJob();
            }
            return new Counters(mrJob.getCounters());
        } catch (Exception ir) {
View Full Code Here

    public static Iterator<TaskReport> getTaskReports(Job job, TaskType type) throws IOException {
        if (job.getJobConf().getBoolean(PigConfiguration.PIG_NO_TASK_REPORT, false)) {
            LOG.info("TaskReports are disabled for job: " + job.getAssignedJobID());
            return null;
        }
        Cluster cluster = new Cluster(job.getJobConf());
        try {
            org.apache.hadoop.mapreduce.Job mrJob = cluster.getJob(job.getAssignedJobID());
            if (mrJob == null) { // In local mode, mrJob will be null
                mrJob = job.getJob();
            }
            org.apache.hadoop.mapreduce.TaskReport[] reports = mrJob.getTaskReports(type);
            return DowngradeHelper.downgradeTaskReports(reports);
View Full Code Here

    }
    return exitCode;
  }

  Cluster createCluster() throws IOException {
    return new Cluster(getConf());
  }
View Full Code Here

  }

  @Test
  public void testMapTaskReportsWithNullJob() throws Exception {
    TestJobClient client = new TestJobClient(new JobConf());
    Cluster mockCluster = mock(Cluster.class);
    client.setCluster(mockCluster);
    JobID id = new JobID("test",0);
   
    when(mockCluster.getJob(id)).thenReturn(null);
   
    TaskReport[] result = client.getMapTaskReports(id);
    assertEquals(0, result.length);
   
    verify(mockCluster).getJob(id);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.mapreduce.Cluster

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.