Search in sources :

Example 6 with TaskReport

use of org.apache.hadoop.mapreduce.TaskReport in project hadoop by apache.

the class JobClientUnitTest method testReduceTaskReportsWithNullJob.

@Test
public void testReduceTaskReportsWithNullJob() 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.getReduceTaskReports(id);
    assertEquals(0, result.length);
    verify(mockCluster).getJob(id);
}
Also used : TaskReport(org.apache.hadoop.mapreduce.TaskReport) Cluster(org.apache.hadoop.mapreduce.Cluster) Test(org.junit.Test)

Example 7 with TaskReport

use of org.apache.hadoop.mapreduce.TaskReport in project hadoop by apache.

the class JobClientUnitTest method testMapTaskReportsWithNullJob.

@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);
}
Also used : TaskReport(org.apache.hadoop.mapreduce.TaskReport) Cluster(org.apache.hadoop.mapreduce.Cluster) Test(org.junit.Test)

Aggregations

TaskReport (org.apache.hadoop.mapreduce.TaskReport)7 Cluster (org.apache.hadoop.mapreduce.Cluster)4 Test (org.junit.Test)4 Function (com.google.common.base.Function)1 WindowedDataSegment (io.druid.indexer.hadoop.WindowedDataSegment)1 IAE (io.druid.java.util.common.IAE)1 ISE (io.druid.java.util.common.ISE)1 DataSegment (io.druid.timeline.DataSegment)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 FileSystem (org.apache.hadoop.fs.FileSystem)1 LocatedFileStatus (org.apache.hadoop.fs.LocatedFileStatus)1 Path (org.apache.hadoop.fs.Path)1 JobConf (org.apache.hadoop.mapred.JobConf)1 TIPStatus (org.apache.hadoop.mapred.TIPStatus)1 Job (org.apache.hadoop.mapreduce.Job)1 JobID (org.apache.hadoop.mapreduce.JobID)1 JobStatus (org.apache.hadoop.mapreduce.JobStatus)1