Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-41525][K8S] Improve
onNewSnapshots
to use unique lists of kn…
…own executor IDs and PVC names ### What changes were proposed in this pull request? This PR improve `ExecutorPodsAllocator.onNewSnapshots` by removing duplications at `k8sKnownExecIds` and `k8sKnownPVCNames`. In the large cluster, this causes inefficiency. ### Why are the changes needed? The existing variables have lots of duplications because `snapshots` is `Seq[ExecutorPodsSnapshot]`. ``` val k8sKnownExecIds = snapshots.flatMap(_.executorPods.keys) ``` For example, if we print out the values, it looks like the following. ``` 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 1 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 2 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 1 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 2 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 1 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 2 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 1 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 2 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 1 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 2 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 1 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 2 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 3 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 1 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 2 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 3 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 1 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 2 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 3 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 1 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 2 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 3 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 1 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 2 22/12/15 07:09:37 INFO ExecutorPodsAllocator: 3 ``` ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Manual review because this is an improvement on the local variable computation. Closes #39070 from dongjoon-hyun/SPARK-41525. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
- Loading branch information