spark-instrumented-optimizer/project
Wu, Xiaochang f6e6d1157a [SPARK-36173][CORE] Support getting CPU number in TaskContext
In stage-level resource scheduling, the allocated 3rd party resources can be obtained in TaskContext using resources() interface, however there is no API to get how many cpus are allocated for the task. Will add a cpus() interface to TaskContext to complement resources(). Althrough the task cpu requests can be got from profile, it's more convenient to get it inside the task code without the need to pass profile from driver side to the executor side.

### What changes were proposed in this pull request?
Add cpus() interface in TaskContext and modify relevant code.

### Why are the changes needed?
TaskContext has resources() to get 3rd party resources allocated. the is no API to get CPU allocated for the task.

### Does this PR introduce _any_ user-facing change?
Add cpus() interface for TaskContext

### How was this patch tested?
Unit tests

Closes #33385 from xwu99/taskcontext-cpus.

Lead-authored-by: Wu, Xiaochang <xiaochang.wu@intel.com>
Co-authored-by: Xiaochang Wu <xiaochang.wu@intel.com>
Signed-off-by: Mridul Muralidharan <mridul<at>gmail.com>
2021-08-04 21:14:01 -05:00
..
build.properties [SPARK-36110][BUILD] Upgrade SBT to 1.5.5 2021-07-13 13:14:10 +09:00
MimaBuild.scala [SPARK-36004][INFRA] Update MiMa and audit API changes 2021-07-06 07:16:07 -05:00
MimaExcludes.scala [SPARK-36173][CORE] Support getting CPU number in TaskContext 2021-08-04 21:14:01 -05:00
plugins.sbt [SPARK-33996][BUILD][FOLLOW-UP] Match SBT's plugin checkstyle version to Maven's 2021-07-05 18:55:45 +09:00
SparkBuild.scala [SPARK-36270][BUILD] Change memory settings for enabling GA 2021-07-23 19:10:45 +09:00