Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-50515][CORE] Add read-only interface to
SparkConf
### What changes were proposed in this pull request? This PR lifts read-only APIs of `SparkConf` into a new `ReadOnlySparkConf`. `SparkContext` now exposes a new read-only API to the conf through `SparkContext.getReadOnlyConf`, which can be used by clients outside the `spark` package if they require only read-only access. The new API avoids copying the entire (potentially large) conf as in `SparkContext.getConf`. This PR also changes all appropriate call sites to use the new API. ### Why are the changes needed? Cloning the entire conf adds unnecessary CPU overhead due to copying, and GC overhead due to cleanup. Both affect tail latencies on certain workloads. ### Does this PR introduce _any_ user-facing change? It adds a new public API `SparkContext.getReadOnlyConf`. ### How was this patch tested? It is a refactoring PR, so we rely on existing tests. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #49100 from pmenon/read-only-confs. Authored-by: Prashanth Menon <prashanth.menon@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
- Loading branch information