Skip to content


TaskResourceRequests is a convenience API to work with TaskResourceRequests (and hence the name 😉).

TaskResourceRequests can be defined as required using ResourceProfileBuilder.

TaskResourceRequests can be specified using configuration properties (using spark.task prefix).

Resource Name Registerer
cpus cpus
user-defined name resource, addRequest

Creating Instance

TaskResourceRequests takes no arguments to be created.

TaskResourceRequests is created when:


TaskResourceRequests is Serializable (Java).


  amount: Int): this.type

cpus registers a TaskResourceRequest with cpus resource name and the given amount (in the _taskResources registry) under the name cpus.

Fluent API

cpus is part of the fluent API of (and hence this strange-looking this.type return type).

cpus is used when:


_taskResources: ConcurrentHashMap[String, TaskResourceRequest]

_taskResources is a collection of TaskResourceRequests by their resource name.

_taskResources is available as requests.


requests: Map[String, TaskResourceRequest]

requests returns the _taskResources (converted to Scala).

requests is used when: