aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/scala/spark/scheduler/TaskSchedulerListener.scala
blob: b75d3736cf5d0b064babcc100e3c63ac0f31c5c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package spark.scheduler

import spark.scheduler.cluster.TaskInfo
import scala.collection.mutable.Map

import spark.TaskEndReason
import spark.executor.TaskMetrics

/**
 * Interface for getting events back from the TaskScheduler.
 */
private[spark] trait TaskSchedulerListener {
  // A task has finished or failed.
  def taskEnded(task: Task[_], reason: TaskEndReason, result: Any, accumUpdates: Map[Long, Any],
                taskInfo: TaskInfo, taskMetrics: TaskMetrics): Unit

  // A node was added to the cluster.
  def executorGained(execId: String, hostPort: String): Unit

  // A node was lost from the cluster.
  def executorLost(execId: String): Unit

  // The TaskScheduler wants to abort an entire task set.
  def taskSetFailed(taskSet: TaskSet, reason: String): Unit
}