ContainerId usedContainerId = event.getUsedContainerId();
// This could be null if a task fails / is killed before a container is
// assigned to it.
if (event.getUsedContainerId() != null) {
sendEvent(new AMContainerEventTASucceeded(usedContainerId,
event.getAttemptID()));
sendEvent(new AMNodeEventTaskAttemptSucceeded(appContext.getAllContainers().
get(usedContainerId).getContainer().getNodeId(), usedContainerId,
event.getAttemptID()));
}