@Test public void testJobToString() throws IOException, InterruptedException { Cluster cluster = mock(Cluster.class); ClientProtocol client = mock(ClientProtocol.class); when(cluster.getClient()).thenReturn(client); JobID jobid = new JobID("1014873536921", 6); JobStatus status = new JobStatus(jobid, 0.0f, 0.0f, 0.0f, 0.0f, State.FAILED, JobPriority.DEFAULT, "root", "TestJobToString", "job file", "tracking url"); when(client.getJobStatus(jobid)).thenReturn(status); when(client.getTaskReports(jobid, TaskType.MAP)).thenReturn( new TaskReport[0]); when(client.getTaskReports(jobid, TaskType.REDUCE)).thenReturn( new TaskReport[0]); when(client.getTaskCompletionEvents(jobid, 0, 10)).thenReturn( new TaskCompletionEvent[0]); Job job = Job.getInstance(cluster, status, new JobConf()); Assert.assertNotNull(job.toString()); }
public TaskReport[] run() throws IOException, InterruptedException { return cluster.getClient().getTaskReports(getJobID(), tmpType); } });
public TaskReport[] run() throws IOException, InterruptedException { return cluster.getClient().getTaskReports(getJobID(), tmpType); } });
public TaskReport[] run() throws IOException, InterruptedException { return cluster.getClient().getTaskReports(getJobID(), tmpType); } });
public TaskReport[] run() throws IOException, InterruptedException { return cluster.getClient().getTaskReports(getJobID(), tmpType); } });
/** * Get the information of the current state of the tasks of a job. * * @param type Type of the task * @return the list of all of the map tips. * @throws IOException */ public TaskReport[] getTaskReports(TaskType type) throws IOException, InterruptedException { ensureState(JobState.RUNNING); return cluster.getClient().getTaskReports(getJobID(), type); }