/**
* Schedules the tasks within a single TaskSet inthe TaskSchedulerImpl. This class keeps track of
* each task, retries tasks if they fail (up to a limited numberoftimes), and
* handles locality-aware scheduling for this TaskSet via delay scheduling. The main interfaces
* toit are resourceOffer, which asks the TaskSet whether it wants torun a task on one node,
* and statusUpdate, which tells itthat one ofits tasks changed state (e.g. finished).
*
* THREADING: This classis designed to only be called from code with a lock onthe
* TaskScheduler (e.g. its event handlers). It should not be called from other threads.
*
* @param sched the TaskSchedulerImpl associated withthe TaskSetManager
* @param taskSet the TaskSet to manage scheduling for
* @param maxTaskFailures if any particular task fails this numberoftimes, the entire
* task set will be aborted
*/
private[spark] class TaskSetManager(
sched: TaskSchedulerImpl,
val taskSet: TaskSet,
val maxTaskFailures: Int,
clock: Clock = new SystemClock()) extends Schedulable with Logging {