Skip to content
Branch: master
Find file History
2 authors and jiangxb1987 [SPARK-27823][CORE] Refactor resource handling code
## What changes were proposed in this pull request?

Continue the work from #24821. Refactor resource handling code to make the code more readable. Major changes:

* Moved resource-related classes to `spark.resource` from `spark`.
* Added ResourceUtils and helper classes so we don't need to directly deal with Spark conf.
 * ResourceID: resource identifier and it provides conf keys
 * ResourceRequest/Allocation: abstraction for requested and allocated resources
* Added `TestResourceIDs` to reference commonly used resource IDs in tests like `spark.executor.resource.gpu`.

cc: tgravescs jiangxb1987 Ngone51

## How was this patch tested?

Unit tests for added utils and existing unit tests.

Closes #24856 from mengxr/SPARK-27823.

Lead-authored-by: Xiangrui Meng <>
Co-authored-by: Thomas Graves <>
Signed-off-by: Xingbo Jiang <>
Latest commit 7056e00 Jun 18, 2019
You can’t perform that action at this time.