name: String
Schedulable
Schedulable
is a contract of schedulable entities.
Note
|
Schedulable is a private[spark] Scala trait. You can find the sources in org.apache.spark.scheduler.Schedulable.
|
There are currently two types of Schedulable
entities in Spark:
Schedulable Contract
Every Schedulable
follows the following contract:
-
It has a
name
. -
It has a
parent
Pool (of otherSchedulables
).parent: Pool
With the
parent
property you could build a tree ofSchedulables
-
It has a
schedulingMode
,weight
,minShare
,runningTasks
,priority
,stageId
.schedulingMode: SchedulingMode weight: Int minShare: Int runningTasks: Int priority: Int stageId: Int
-
It manages a collection of Schedulables and can add or remove one.
schedulableQueue: ConcurrentLinkedQueue[Schedulable] addSchedulable(schedulable: Schedulable): Unit removeSchedulable(schedulable: Schedulable): Unit
NoteschedulableQueue
is java.util.concurrent.ConcurrentLinkedQueue. -
It can query for a
Schedulable
by name.getSchedulableByName(name: String): Schedulable
-
It can be informed about lost executors.
executorLost(executorId: String, host: String, reason: ExecutorLossReason): Unit
It is called by TaskSchedulerImpl to inform TaskSetManagers about executors being lost.
-
It checks for speculatable tasks.
checkSpeculatableTasks(): Boolean
CautionFIXME What are speculatable tasks?
getSortedTaskSetQueue
getSortedTaskSetQueue: ArrayBuffer[TaskSetManager]
getSortedTaskSetQueue
is used in TaskSchedulerImpl
to handle resource offers (to let every TaskSetManager know about a new executor ready to execute tasks).
schedulableQueue
schedulableQueue: ConcurrentLinkedQueue[Schedulable]
schedulableQueue
is used in SparkContext.getAllPools.