QueueManagerTestUtils.writeQueueConfigurationFile(
queueConfigFile.getAbsolutePath(), new JobQueueInfo[]{queues[0]});
setupAndStartSchedulerFramework(2, 2, 2);
FakeJobInProgress job1 =
taskTrackerManager.submitJobAndInit(
JobStatus.PREP, 2, 2,
queues[1].getQueueName(), "user");
FakeJobInProgress job2 =
taskTrackerManager.submitJobAndInit(
JobStatus.PREP, 2, 2,
queues[2].getQueueName(), "user");
Map<String, String> expectedStrings = new HashMap<String, String>();
expectedStrings.put(MAP, "attempt_test_0001_m_000001_0 on tt1");
expectedStrings.put(REDUCE, "attempt_test_0001_r_000001_0 on tt1");
checkMultipleTaskAssignment(
taskTrackerManager, scheduler, "tt1",
expectedStrings);
//===========================================
expectedStrings.clear();
expectedStrings.put(MAP, "attempt_test_0002_m_000001_0 on tt1");
expectedStrings.put(REDUCE, "attempt_test_0002_r_000001_0 on tt1");
checkMultipleTaskAssignment(
taskTrackerManager, scheduler, "tt1",
expectedStrings);
//============================================
expectedStrings.clear();
expectedStrings.put(MAP, "attempt_test_0002_m_000002_0 on tt2");
expectedStrings.put(REDUCE, "attempt_test_0002_r_000002_0 on tt2");
checkMultipleTaskAssignment(
taskTrackerManager, scheduler, "tt2",
expectedStrings);
//============================================
expectedStrings.clear();
expectedStrings.put(MAP, "attempt_test_0001_m_000002_0 on tt2");
expectedStrings.put(REDUCE, "attempt_test_0001_r_000002_0 on tt2");
checkMultipleTaskAssignment(
taskTrackerManager, scheduler, "tt2",
expectedStrings);
taskTrackerManager.killJob(job1.getJobID());
taskTrackerManager.killJob(job2.getJobID());
// change configuration
queues[1].getProperties().setProperty(
CapacitySchedulerConf.CAPACITY_PROPERTY, String.valueOf(25));
queues[2].getProperties().setProperty(