Skip to content

= TaskDescription

[[creating-instance]] TaskDescription is a metadata of a scheduler:Task.md[task] with the following properties:

  • [[taskId]] Task ID
  • [[attemptNumber]] Task attempt number
  • [[executorId]] Executor ID
  • [[name]] Task name
  • [[index]] Task index (within the scheduler:TaskSet.md[TaskSet])
  • [[addedFiles]] Added files (as Map[String, Long])
  • [[addedJars]] Added JAR files (as Map[String, Long])
  • [[properties]] Properties
  • [[serializedTask]] Serialized task (as ByteBuffer)

The <> of the task is of the format:

task [taskID] in stage [taskSetID]

TaskDescription is <> exclusively when TaskSetManager is requested to scheduler:TaskSetManager.md#resourceOffer[find a task ready for execution (given a resource offer)].

[[toString]] The textual representation of a TaskDescription is as follows:

TaskDescription(TID=[taskId], index=[index])

== [[decode]] Decoding TaskDescription (from Serialized Format)

[source, scala]

decode(byteBuffer: ByteBuffer): TaskDescription

decode simply decodes (<>) a TaskDescription from the serialized format (ByteBuffer).

Internally, decode...FIXME

[NOTE]

decode is used when:

  • CoarseGrainedExecutorBackend is requested to CoarseGrainedExecutorBackend.md#LaunchTask[handle a LaunchTask message]

* Spark on Mesos' MesosExecutorBackend is requested to spark-on-mesos:spark-executor-backends-MesosExecutorBackend.md#launchTask[launch a task]

== [[encode]] Encoding TaskDescription (to Serialized Format)

[source, scala]

encode(taskDescription: TaskDescription): ByteBuffer

encode simply encodes the TaskDescription to a serialized format (ByteBuffer).

Internally, encode...FIXME

[NOTE]

encode is used when:

  • DriverEndpoint (of CoarseGrainedSchedulerBackend) is requested to scheduler:CoarseGrainedSchedulerBackend-DriverEndpoint.md#launchTasks[launchTasks]

* Spark on Mesos' MesosFineGrainedSchedulerBackend is requested to createMesosTask


Last update: 2020-10-06