Skip to content


TaskDescription is a metadata of a Task.

Creating Instance

TaskDescription takes the following to be created:

  • Task ID
  • Task attempt number
  • Executor ID
  • Task name
  • Task index (within the TaskSet)
  • Partition ID
  • Added files (as Map[String, Long])
  • Added JAR files (as Map[String, Long])
  • Properties
  • Resources
  • Serialized task (as ByteBuffer)

TaskDescription is created when:


resources: Map[String, ResourceInformation]

TaskDescription is given resources when created.

The resources are either specified when TaskSetManager is requested to resourceOffer (and prepareLaunchingTask) or decoded from bytes.

Text Representation

toString: String

toString uses the taskId and index as follows:

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

Decoding TaskDescription (from Serialized Format)

  byteBuffer: ByteBuffer): TaskDescription

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

Internally, decode...FIXME

decode is used when:

  • CoarseGrainedExecutorBackend is requested to[handle a LaunchTask message]

  • Spark on Mesos' MesosExecutorBackend is requested to[launch a task]

Encoding TaskDescription (to Serialized Format)

  taskDescription: TaskDescription): ByteBuffer

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

Internally, encode...FIXME

encode is used when:

  • DriverEndpoint (of CoarseGrainedSchedulerBackend) is requested to launchTasks

Task Name

The name of the task is of the format:

task [taskID] in stage [taskSetID]