Package org.apache.spark.resource
Class TaskResourceRequests
Object
org.apache.spark.resource.TaskResourceRequests
- All Implemented Interfaces:
Serializable
,scala.Serializable
A set of task resource requests. This is used in conjunction with the ResourceProfile to
programmatically specify the resources needed for an RDD that will be applied at the
stage level.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdd a certainTaskResourceRequest
to the request set.cpus
(int amount) Specify number of cpus per Task.scala.collection.immutable.Map<String,
TaskResourceRequest> requests()
Returns all the resource requests for the task.(Java-specific) Returns all the resource requests for the task.Amount of a particular custom resource(GPU, FPGA, etc) to use.toString()
-
Constructor Details
-
TaskResourceRequests
public TaskResourceRequests()
-
-
Method Details
-
addRequest
Add a certainTaskResourceRequest
to the request set.- Parameters:
treq
- (undocumented)- Returns:
- (undocumented)
-
cpus
Specify number of cpus per Task. This is a convenient API to addTaskResourceRequest
for cpus.- Parameters:
amount
- Number of cpus to allocate per Task.- Returns:
- (undocumented)
-
requests
Returns all the resource requests for the task.- Returns:
- (undocumented)
-
requestsJMap
(Java-specific) Returns all the resource requests for the task.- Returns:
- (undocumented)
-
resource
Amount of a particular custom resource(GPU, FPGA, etc) to use. This is a convenient API to addTaskResourceRequest
for custom resources.- Parameters:
resourceName
- Name of the resource.amount
- Amount requesting as a Double to support fractional resource requests. Valid values are less than or equal to 0.5 or whole numbers. This essentially lets you configure X number of tasks to run on a single resource, ie amount equals 0.5 translates into 2 tasks per resource address.- Returns:
- (undocumented)
-
toString
-