}
}
private void handleTaLaunchRequest(AMSchedulerEventTALaunchRequest event) {
TaskAttempt taskAttempt = event.getTaskAttempt();
TaskLocationHint locationHint = event.getLocationHint();
String hosts[] = null;
String racks[] = null;
if (locationHint != null) {
if (locationHint.getAffinitizedContainer() != null) {
taskScheduler.allocateTask(taskAttempt,
event.getCapability(),
locationHint.getAffinitizedContainer(),
event.getPriority(),
event.getContainerContext(),
event);
return;
} else {
hosts = (locationHint.getHosts() != null) ? locationHint
.getHosts().toArray(
new String[locationHint.getHosts().size()]) : null;
racks = (locationHint.getRacks() != null) ? locationHint.getRacks()
.toArray(new String[locationHint.getRacks().size()]) : null;
}
}
taskScheduler.allocateTask(taskAttempt,
event.getCapability(),