@Test public void testZeroMapReduces() throws Exception{ MRApp app = new MRApp(0, 0, true, this.getClass().getName(), true); Job job = app.submit(new Configuration()); app.waitForState(job, JobState.SUCCEEDED); }
@Test public void testZeroMaps() throws Exception { MRApp app = new MRApp(0, 1, true, this.getClass().getName(), true); Job job = app.submit(new Configuration()); app.waitForState(job, JobState.SUCCEEDED); app.verifyCompleted(); }
@SuppressWarnings("resource") @Test public void testJobSuccess() throws Exception { MRApp app = new MRApp(2, 2, true, this.getClass().getName(), true, false); JobImpl job = (JobImpl) app.submit(new Configuration()); app.waitForInternalState(job, JobStateInternal.SUCCEEDED); // AM is not unregistered Assert.assertEquals(JobState.RUNNING, job.getState()); // imitate that AM is unregistered app.successfullyUnregistered.set(true); app.waitForState(job, JobState.SUCCEEDED); }
@Test public void testMapReduce() throws Exception { MRApp app = new MRApp(2, 2, true, this.getClass().getName(), true); Job job = app.submit(new Configuration()); app.waitForState(job, JobState.SUCCEEDED); app.verifyCompleted(); Assert.assertEquals(System.getProperty("user.name"),job.getUserName()); }
@Test public void testJobRebootNotLastRetryOnUnregistrationFailure() throws Exception { MRApp app = new MRApp(1, 0, false, this.getClass().getName(), true); Job job = app.submit(new Configuration()); app.waitForState(job, JobState.RUNNING); Assert.assertEquals("Num tasks not correct", 1, job.getTasks().size()); Iterator<Task> it = job.getTasks().values().iterator(); Task task = it.next(); app.waitForState(task, TaskState.RUNNING); //send an reboot event app.getContext().getEventHandler().handle(new JobEvent(job.getID(), JobEventType.JOB_AM_REBOOT)); // return exteranl state as RUNNING since otherwise the JobClient will // prematurely exit. app.waitForState(job, JobState.RUNNING); }
@Test public void testJobError() throws Exception { MRApp app = new MRApp(1, 0, false, this.getClass().getName(), true); Job job = app.submit(new Configuration()); app.waitForState(job, JobState.RUNNING); Assert.assertEquals("Num tasks not correct", 1, job.getTasks().size()); Iterator<Task> it = job.getTasks().values().iterator(); Task task = it.next(); app.waitForState(task, TaskState.RUNNING); //send an invalid event on task at current state app.getContext().getEventHandler().handle( new TaskEvent( task.getID(), TaskEventType.T_SCHEDULE)); //this must lead to job error app.waitForState(job, JobState.ERROR); }
@Test public void testJobRebootOnLastRetryOnUnregistrationFailure() throws Exception { // make startCount as 2 since this is last retry which equals to // DEFAULT_MAX_AM_RETRY // The last param mocks the unregistration failure MRApp app = new MRApp(1, 0, false, this.getClass().getName(), true, 2, false); Configuration conf = new Configuration(); Job job = app.submit(conf); app.waitForState(job, JobState.RUNNING); Assert.assertEquals("Num tasks not correct", 1, job.getTasks().size()); Iterator<Task> it = job.getTasks().values().iterator(); Task task = it.next(); app.waitForState(task, TaskState.RUNNING); //send an reboot event app.getContext().getEventHandler().handle(new JobEvent(job.getID(), JobEventType.JOB_AM_REBOOT)); app.waitForInternalState((JobImpl) job, JobStateInternal.REBOOT); // return exteranl state as RUNNING if this is the last retry while // unregistration fails app.waitForState(job, JobState.RUNNING); }
new MRApp(NUM_MAPPERS, NUM_REDUCERS, false, "test", true, clock); Job job = app.submit(new Configuration(), true, true); app.waitForState(job, JobState.RUNNING);
new MRApp(NUM_MAPPERS, NUM_REDUCERS, false, "test", true, clock); Job job = app.submit(new Configuration(), true, true); app.waitForState(job, JobState.RUNNING);
public void testCompletedMapsForReduceSlowstart() throws Exception { MRApp app = new MRApp(2, 1, false, this.getClass().getName(), true); Configuration conf = new Configuration();
@Test public void testCommitPending() throws Exception { MRApp app = new MRApp(1, 0, false, this.getClass().getName(), true); Job job = app.submit(new Configuration()); app.waitForState(job, JobState.RUNNING);
clock.setTime(10); MRApp app = new MRApp(1, 1, false, "testSlotMillisCounterUpdate", true, clock); app.setAllocatedContainerResource(containerResource); Configuration conf = new Configuration();
@Test public void testFetchFailure() throws Exception { MRApp app = new MRApp(1, 1, false, this.getClass().getName(), true); Configuration conf = new Configuration();
@Test public void testFetchFailureMultipleReduces() throws Exception { MRApp app = new MRApp(1, 3, false, this.getClass().getName(), true); Configuration conf = new Configuration();